#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  long long sum = 0;
  for (int i = 5; i <= 7; i++) {
    long long a = 1;
    for (int k = n, j = 1; k >= n - i + 1 || j <= i; k--, j++) {
      a *= k;
      a /= j;
    }
    sum += a;
  }
  printf("%I64d\n", sum);
}
