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