
  #include <bits/stdc++.h>
  using namespace std;

  int main() {
     int N;
     cin >> N;
     long long A,B,C,D;
     A=N*(N+1)/2;
     B=N*(N+3)/6;
     C=N*(N+5)/10;
     D=N*(N+15)/30;

     cout << A+D-B-C;
   

  }
      