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