#include <bits/stdc++.h>
using namespace std;
long long Choose(long long n, long long k) {
  long long res = 1;
  for (long long i = 0; i < k; i++) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
int main() {
  long long n;
  cin >> n;
  cout << Choose(n, 7) + Choose(n, 6) + Choose(n, 5);
  return 0;
}
