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