#include <bits/stdc++.h>
using namespace std;
vector<int> p;
bool is_prime(int n) {
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      return false;
    }
  }
  return true;
}
unsigned long long get(int n, int k) {
  vector<int> cnt((int)(p).size(), 0);
  for (int i = 2; i <= n; i++) {
    int x = i;
    for (int j = 0; j < (int)(p).size(); j++) {
      while (x % p[j] == 0) {
        x /= p[j];
        cnt[j]++;
      }
    }
  }
  for (int i = 2; i <= k; i++) {
    int x = i;
    for (int j = 0; j < (int)(p).size(); j++) {
      while (x % p[j] == 0) {
        x /= p[j];
        cnt[j]--;
      }
    }
  }
  for (int i = 2; i <= n - k; i++) {
    int x = i;
    for (int j = 0; j < (int)(p).size(); j++) {
      while (x % p[j] == 0) {
        x /= p[j];
        cnt[j]--;
      }
    }
  }
  unsigned long long res = 1;
  for (int i = 0; i < (int)(p).size(); i++) {
    for (int j = 1; j <= cnt[i]; j++) {
      res *= p[i];
    }
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  for (int i = 2; i <= 1000; i++) {
    if (is_prime(i)) {
      p.push_back(i);
    }
  }
  int n;
  cin >> n;
  unsigned long long res = 0;
  for (int k = 5; k <= 7; k++) {
    res += get(n, k);
  }
  cout << res << "\n";
  return 0;
}
