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