#include <bits/stdc++.h>
using namespace std;
const int maxn = 778;
long long C[maxn + 1][maxn + 1];
int main() {
  long long u;
  cin >> u;
  for (int n = 0; n <= maxn; ++n) {
    C[n][0] = C[n][n] = 1;
    for (int k = 1; k < n; ++k) C[n][k] = C[n - 1][k - 1] + C[n - 1][k];
  }
  cout << C[u][5] + C[u][6] + C[u][7];
  cin.get(), cin.get();
  return 0;
}
