#include <bits/stdc++.h>
using namespace std;
double pwr(double a, long int b) {
  double ans = 1;
  while (b) {
    if (b & 1) ans = ans * a;
    a = a * a;
    b /= 2;
  }
  return ans;
}
int gcd(int a, int b) {
  while (b) {
    int temp = a;
    a = b;
    b = temp % b;
  }
  return a;
}
int main() {
  long long n, ans = 0;
  cin >> n;
  long long tmp = (n * (n - 1) * (n - 2) * (n - 3) * (n - 4)) / 120;
  ans = tmp;
  tmp *= (n - 5);
  tmp /= 6;
  ans += tmp;
  tmp *= (n - 6);
  tmp /= 7;
  ans += tmp;
  cout << ans;
  return 0;
}
