#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int total = 0;
  long long int a = n + 1;
  total += ((((a * (a - 1) / 2) * (a - 2) / 3) * (a - 3) / 4) * (a - 4) / 5) *
           (a - 5) / 6;
  total += (((((n * (n - 1) / 2) * (n - 2) / 3) * (n - 3) / 4) * (n - 4) / 5) *
            (n - 5) / 6) *
           (n - 6) / 7;
  cout << total << endl;
  return 0;
}
