#include<iostream>
#include<string>
using namespace std;

int main(void){
  long n;
  cin >> n;
  long res = 0;
  long m = n/15;
  res = 15*8*m*(m-1)/2 + (1+2+4+7+8+11+13+14)*m;
  if(n%15 > 0) res+=m*15+1;
  if(n%15 > 1) res+=m*15+2;
  if(n%15 > 3) res+=m*15+4;
  if(n%15 > 6) res+=m*15+7;
  if(n%15 > 7) res+=m*15+8;
  if(n%15 > 10) res+=m*15+11;
  if(n%15 > 12) res+=m*15+13;
  if(n%15 > 13) res+=m*15+14;
  cout << res << endl;
  return 0;
}