#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <cassert>
#include <functional>

using namespace std;
typedef long long ll;


#define SIZE 26
#define INF 1000000000
#define LLINF 1000000000000000000LL

ll dp[5][5001];

bool solve(){
  int n;
  
  if(scanf("%d", &n) == EOF) return false;
  
  printf("%lld\n", dp[4][n]);
  
  return true;
}

int main(){

  dp[0][0] = 1;

  for(int i=0;i<4;i++){
    for(int j=0;j<=i*1000;j++){
      for(int k=0;k<=1000;k++){
        dp[i+1][j+k] += dp[i][j]; 
      }
    }
  }
  
  while(solve());
  
  return 0;
}

