#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int dp[5][4444];
int solve(int k,int sum){
  if(k==4) return sum?0:1;
  if(dp[k][sum]) return dp[k][sum];

  int ret = 0;
  for(int i = 0; i <= 1000 && i <= sum; i++){
    ret += solve(k+1,sum-i);
  }
  return dp[k][sum] = ret;
}
int main(void){
  int n;
  for(int i = 0; i <= 4000; i++) solve(0,i);
  while(cin >> n){
    cout << solve(0,n) << endl;
  }
}