#include <bits/stdc++.h>
using namespace std;
const int N = 778, mod = 1e9 + 7;
long long int Comp[N][N];
int main() {
  Comp[0][0] = 1;
  for (int i = 1; i < N; i++) {
    Comp[i][i] = 1;
    Comp[i][0] = 1;
    for (int j = 1; j < 8; j++) {
      Comp[i][j] = Comp[i - 1][j] + Comp[i - 1][j - 1];
    }
  }
  long long int n;
  cin >> n;
  cout << Comp[n][5] + Comp[n][6] + Comp[n][7];
}
