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