#include <bits/stdc++.h>
using namespace std;
int inf = 1000000000;
int dp[5][4001];
int main(void) {
  for (int i = 0; i <= 1000; i++) dp[1][i] = 1;
  for (int i = 2; i < 5; i++) {
    for (int j = 0; j <= 1000 * i; j++) {
      for (int k = 0; k <= 1000 * i; k++) {
        if (j + k > 4000) continue;
        dp[i][j + k] += dp[i - 1][j];
      }
    }
  }
  int n;
  while (cin >> n) {
    cout << dp[4][n] << endl;
  }
  return 0;
}
