#include <bits/stdc++.h>
using namespace std;
long long C(int n, int r) {
  if (r > n / 2) r = n - r;
  long long ans = 1;
  int i;
  for (i = 1; i <= r; i++) {
    ans *= n - r + i;
    ans /= i;
  }
  return ans;
}
int main() {
  long long num;
  cin >> num;
  cout << C(num, 5) + C(num, 6) + C(num, 7) << endl;
}
