#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long sum = 0, temp = 1;
  for (long long int i = 0; i < 5; i++) {
    temp = temp * (n - i);
    temp = temp / (i + 1);
  }
  sum += temp;
  temp = 1;
  for (long long int i = 0; i < 6; i++) {
    temp = temp * (n - i);
    temp = temp / (i + 1);
  }
  sum += temp;
  temp = 1;
  for (long long int i = 0; i < 7; i++) {
    temp = temp * (n - i);
    temp = temp / (i + 1);
  }
  sum += temp;
  cout << sum;
}
