#include <bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  unsigned long long c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
int main() {
  unsigned long long n, p, i, j, sum, sum1, sum2;
  cin >> n;
  sum2 = 0;
  for (i = 5; i <= 7; i++) {
    sum = 1, sum1 = 1;
    for (j = 1; j <= i; j++) {
      sum = sum * j;
      sum1 = sum1 * (n - (j - 1));
      p = gcd(sum, sum1);
      sum = sum / p;
      sum1 = sum1 / p;
    }
    sum2 = sum2 + (sum1 / sum);
  }
  cout << sum2 << "\n";
}
