#include <bits/stdc++.h>
long long choose(int n, int r) {
  return r == 0 ? 1 : choose(n - 1, r - 1) * n / r;
}
int main() {
  int n, x;
  long long ans;
  scanf("%d", &n);
  ans = 0;
  for (x = 5; x <= 7; x++) ans += choose(n, x);
  printf("%lld\n", ans);
  return 0;
}
