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