
import std.stdio, std.c.string;

int dp[5][4001];

int solve_rec(int n, int index) {
  if (index > 4 || n < 0) return 0;
  if (n == 0 && index == 4) return 1;
  if (dp[index][n] >= 0) return dp[index][n];
  int counter;
  for(int i = 0; i <= 1000; i++) {
    counter += solve_rec(n - i, index + 1);
  }
  return dp[index][n] = counter;
}

void main() {
  memset(cast(void *)dp, -1, dp.sizeof);
  for(int n; readf("%d\n", &n);)
    solve_rec(n, 0).writeln;
}