#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int N, a, b, c;
  cin >> N;
  a = (N - 4) * (N - 3) * (N - 2) * (N - 1) * (N) / 120;
  b = a * (N - 5) / 6;
  c = b * (N - 6) / 7;
  cout << a + b + c;
  return 0;
}
