#include <bits/stdc++.h>
using namespace std;
long long c[800][9];
int main() {
  int n;
  cin >> n;
  c[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    c[i][0] = 1;
    for (int j = 1; j <= 7; j++) c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
  }
  cout << c[n][5] + c[n][6] + c[n][7] << endl;
  return 0;
}
