#include <bits/stdc++.h>
#define int long long // at least int64 > 9*10^18
#define ENDL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using namespace std;
signed main (){
  int a;
  cin>>a;
  int b;
  b=a%15;
  int c;
  c=a/15;
  
  int d;
  if(c>0){
  d=(60+120*(c-1))*c/2;
  }
  if(b>=1){
    d+=1+c*15;
  }
  if(b>=2){
    d+=2+c*15;
  }
  if(b>=4){
    d+=4+c*15;
  }
  if(b>=7){
    d+=7+c*15;
  }
  if(b>=8){
    d+=8+c*15;
  }
  if(b>=11){
    d+=11+c*15;
  }
  if(b>=13){
    d+=13+c*15;
  }
  if(b>=14){
    d+=14+c*15;
  }
  cout<<d<<endl;
}