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