#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<utility>
#include<cstdio>
#include<set>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include <bitset>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,x,n) for (int i= x;i<n;i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using vi = vector<int>; 
using vvi = vector<vi>;
typedef pair<int,int> P;
string s;
int k;
ll INF = 10000000000000000;
int main(){
    ll N;
    cin >>N;
    ll M,m;
    M = 0;
    m = 0;
    M = N/15;
    m = N%15;
    long long S;
    S = 0;
    S += 60*M+120*M*(M-1)/2;
    vi v={0,1,3,3,7,7,7,14,22,22,22,33,33,46,60};
    vi v2={0,1,2,2,3,3,3,4,5,5,5,6,6,7,8};
    S += 15*M*v2[m]+v[m];
    cout << S << endl; 
}