#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N;
ll dp[5][5555];
int main(){
  dp[0][0] = 1;
  for(int i=0;i<4;i++){
    for(int j=0;j<=4000;j++){
      if( dp[i][j] == 0 ) continue;
      for(int k=0;k<=1000;k++){
	if( j+k > 4000 ) break;
	dp[i+1][j+k] += dp[i][j];
      }
    }
  }
  while ( cin >> N ){
    cout << dp[4][N] << endl;
  }
  
}