#include <bits/stdc++.h>
using namespace std;
int dp[4][4001];
int main() {
  int n;
  for (int i = 0; i <= 4000; i++) {
    dp[0][i] = 1;
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j <= 1000; j++) {
      for (int k = 0; k <= 1000; k++) {
        dp[i + 1][j + k] += dp[i][j];
      }
    }
  }
  while (cin >> n) {
    printf("%d\n", dp[3][n]);
  }
  return 0;
}
