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