#include <bits/stdc++.h>
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return a > b ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
using namespace std;
unsigned long long choose(unsigned long long n, unsigned long long k) {
  if (k > n) {
    return 0;
  }
  unsigned long long r = 1;
  for (unsigned long long d = 1; d <= k; ++d) {
    r *= n--;
    r /= d;
  }
  return r;
}
int main() {
  unsigned long long n, res = 0;
  cin >> n;
  for (int i = 5; i <= 7; i++) res += choose(n, i);
  cout << res << endl;
  return 0;
}
