#include <bits/stdc++.h>
using namespace std;
unsigned long long int combinations(int n, int k) {
  unsigned long long int result = 1;
  for (int i = 0; i < k; ++i) {
    result *= n - i;
    result /= i + 1;
  }
  return result;
}
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  unsigned long long int result = combinations(n, 5);
  result += combinations(n, 6);
  result += combinations(n, 7);
  cout << result;
  return 0;
}
