#include <bits/stdc++.h>
int main() {
  unsigned long long int n;
  scanf(" %llu", &n);
  printf("%llu\n", n * (n - 1) / 2 * (n - 2) / 3 * (n - 3) * (n - 4) / 20 +
                       n * (n - 1) / 2 * (n - 2) / 3 * (n - 3) * (n - 4) / 20 *
                           (n - 5) / 6 +
                       n * (n - 1) / 2 * (n - 2) / 3 * (n - 3) * (n - 4) / 20 *
                           (n - 5) * (n - 6) / 42);
  return 0;
}
