#include<iostream>
#include<cstdio>
using namespace std;

int main(int argc, char *argv[]){
  int n;
  int a_add_b[2001] = {0};
  
  for (int i = 0; i <= 1000; i++) {
    for (int j = 0; j <= 1000; j++) {
      a_add_b[i + j]++;
    }
  }
  
  while(scanf("%d", &n) != EOF){
    long long int  ans = 0;
    for (int i = 0; i <= 2000; i++) {
      if(0 <= n - i && n - i <= 2000)
        ans += a_add_b[i] * a_add_b[n - i];
    }
    std::cout << ans << std::endl;
  }
  return 0;
}