#include <bits/stdc++.h>
using namespace std;
int n;
long long C(int n, int m) {
  if (n - m > m) m = n - m;
  long long ans = 1ll;
  for (int i = 1; i <= n - m; i++) ans = ans * (m + i) / i;
  return ans;
}
int main() {
  while (~scanf("%d", &n)) printf("%I64d\n", C(n, 5) + C(n, 6) + C(n, 7));
  return 0;
}
