#include <bits/stdc++.h>
using namespace std;
long long dp[4001][5][1001];
int main() {
  for (int i = 0; i < 4001; ++i) {
    for (int j = 1; j <= 4; ++j) {
      for (int k = 0; k < 1001; ++k) {
        if (i == 0) {
          dp[i][j][k] = 1;
        } else if (j == 1) {
          dp[i][j][k] = i <= k;
        } else if (k == 0) {
          dp[i][j][k] = 0;
        } else if (i > k) {
          dp[i][j][k] =
              dp[i - 1][j][k] - dp[i - k - 1][j - 1][k] + dp[i][j - 1][k];
        } else {
          dp[i][j][k] = dp[i - 1][j][k] + dp[i][j - 1][k];
        }
      }
    }
  }
  int n;
  while (scanf("%d", &n) != EOF) {
    printf("%lld\n", dp[n][4][1000]);
  }
  return 0;
}
