#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
long long C(long long n, long long m) {
  long long ans = 1;
  for (long long i = 1; i <= m; ++i) {
    ans *= (n - i + 1);
    ans /= i;
  }
  return ans;
}
int main() {
  long long n;
  cin >> n;
  cout << C(n, 5) + C(n, 6) + C(n, 7) << endl;
  return 0;
}
