#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<unordered_map>

using namespace std;
typedef pair<long long int, long long int> P;

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

long long int DP[6000] = {};

int main(){
  DP[0] = 1;
  for(int loop = 0; loop < 4; loop++){
    for(int j = 4000; j >= 0; j--){
      for(int k = 1; k <= 1000; k++){
        DP[j + k] += DP[j];
      }
    }
  }
  while(true){
    int n;
    cin >> n;
    if(cin.eof()){
      break;
    }
    cout << DP[n] << endl;
  }
  return 0;
}

