#include <bits/stdc++.h>
int main() {
  unsigned long long w = 0, c5, c6, c7, n;
  scanf("%I64d", &n);
  c5 = n * (n - 1) * (n - 2) * (n - 3) * (n - 4) / 120;
  c6 = c5 * (n - 5) / 6;
  c7 = c6 * (n - 6) / 7;
  printf("%I64u", c5 + c6 + c7);
  return 0;
}
