#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 100;
long long C(int n, int r) {
  long long sum = 1;
  for (int i = 1; i <= r; i++) sum = sum * (n + 1 - i) / i;
  return sum;
}
int main() {
  long long n;
  cin >> n;
  cout << C(n, 5) + C(n, 6) + C(n, 7) << endl;
  return 0;
}
