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