#include <bits/stdc++.h>
using namespace std;
long long calculate(long long n, long long i);
int main() {
  long long n;
  while (scanf("%lld", &n) != EOF) {
    if (n == 5) {
      printf("1\n");
    } else if (n == 7) {
      printf("29\n");
    } else if (n == 6) {
      printf("7\n");
    } else {
      long long i;
      long long sum = 0;
      for (i = 7; i >= 5; i--) {
        sum = sum + calculate(n, i);
      }
      printf("%lld\n", sum);
    }
  }
  return 0;
}
long long calculate(long long n, long long i) {
  long long num = 1;
  long long k, j;
  for (j = n, k = 1; k <= i && j >= n - i + 1; k++, j--) {
    num = num * j;
    num = num / k;
  }
  return num;
}
