#include <bits/stdc++.h>
using namespace std;
unsigned long long s;
int n;
unsigned long long comb(int n, int k);
int main() {
  cin >> n;
  s += comb(n, 5);
  s += comb(n, 6);
  s += comb(n, 7);
  cout << s << '\n';
  return 0;
}
unsigned long long comb(int n, int k) {
  bool ok[8] = {0};
  unsigned long long p = 1;
  for (int i = n - k + 1; i <= n; i++) {
    p = p * i;
    for (int j = 2; j <= k; j++)
      if (!ok[j] && p % j == 0) p = p / j, ok[j] = 1;
  }
  return p;
}
