#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e17;
const int MAXM = 1e5 + 5;
const int MAXN = 1e6 + 4;
long long fact[MAXM];
long long nChoosek(long long n, long long k) {
  if (k > n) return 0;
  if (k * 2 > n) k = n - k;
  if (k == 0) return 1;
  long long result = n;
  for (long long i = 2; i <= k; ++i) {
    result *= (n - i + 1);
    result /= i;
  }
  return result;
}
int main() {
  long long n;
  cin >> n;
  long long Ans = 0;
  for (long long i = 5; i <= 7; i++) {
    Ans += nChoosek(n, i);
  }
  cout << Ans << endl;
  return 0;
}
