#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x, y, z;
  cin >> n;
  x = n * (n - 1) * (n - 2) * (n - 3) * (n - 4) / (5 * 4 * 3 * 2);
  y = n * (n - 1) * (n - 2) / 6 * (n - 3) / 4 * (n - 4) / 5 * (n - 5) / 6;
  z = n * (n - 1) * (n - 2) / 6 * (n - 3) / 4 * (n - 4) / 5 * (n - 5) / 6 *
      (n - 6) / 7;
  cout << x + y + z;
  return 0;
}
