#include <bits/stdc++.h>
using namespace std;
const long long INF = 1 << 30;
const long long LINF = 1LL << 62;
const double EPS = 1e-9;
const long long MOD = 1e9 + 7;
int main() {
  long long n = 0;
  cin >> n;
  long long l = 1, m = 1, r = 1;
  for (long long i = 0; i < 5; i++) {
    l *= (n - i);
  }
  l /= 120LL;
  m = l * (n - 5LL) / 6;
  r = m * (n - 6LL) / 7;
  cout << l + m + r << ("\n");
  return 0;
}
