#include<iostream>

#define NUM 4
#define N 4000
#define X 1000

using namespace std;

int main(){

  int n, m, l;
  int comb[NUM][N+1] = {0};

  m = X + 1;
  for(int i=0; i<m; i++){
    comb[0][i] = 1;
  }

  for(int i=1; i<NUM; i++){
    l = X * i + m;
    for(int j=0; j<l; j++){
      for(int k=0; k<m; k++){
        if(j-k>=0){
          comb[i][j] += comb[i-1][j-k];
        }
      }
    }
  }

/*  for(int i=0; i<4; i++){
    for(int j=0; j<51; j++){
      cout << comb[i][j] << " ";
    }
    cout << endl;
  }
*/

  while(cin >> n){
    cout << comb[NUM-1][n] << endl;
  }

  return 0;
}