#include <bits/stdc++.h>
const long long MAXN = 1e4 + 1, MOD = 998244353, INF = 1e9 + 2;
using namespace std;
long long a[778][778];
void fiill() {
  a[0][0] = 1;
  a[1][0] = 1;
  a[1][1] = 1;
  for (int i = 2; i <= 777; i++) {
    for (int j = 0; j <= i; j++) {
      if (j == 0) {
        a[i][j] = 1;
      } else {
        a[i][j] = (a[i - 1][j - 1] + a[i - 1][j]);
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    fiill();
    cout << a[n][5] + a[n][6] + a[n][7] << endl;
  }
  return 0;
}
