#include <bits/stdc++.h>
using namespace std;
long long fac(long long x) { return (x < 2) ? 1 : x * fac(x - 1); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  unsigned long long n;
  cin >> n;
  unsigned long long f5 = 1, f6, f7, fn5 = 1, fn6 = 1, fn7 = 1;
  bool b1, b2, b3;
  b1 = b2 = b3 = 0;
  f5 = 12;
  f6 = 72;
  f7 = 504;
  for (int i = 0; i < 5; i++) {
    fn5 *= n - i;
    if (fn5 % 10 == 0 && !b1) fn5 /= 10, b1 = 1;
  }
  for (int i = 0; i < 6; i++) {
    fn6 *= n - i;
    if (fn6 % 10 == 0 && !b2) fn6 /= 10, b2 = 1;
  }
  for (int i = 0; i < 7; i++) {
    fn7 *= n - i;
    if (fn7 % 10 == 0 && !b3) fn7 /= 10, b3 = 1;
  }
  cout << fn7 / f7 + fn6 / f6 + fn5 / f5;
}
