#include<deque>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<numeric>
#include<cmath>
#include<cstdio>
#include<cstring>
using namespace std;
int a[3][4001];
int f(int p,int q){
  int i;
  if(p==1)
    return 0<=q&&q<=1000;
  if(a[p-2][q]>=0)
    return a[p-2][q];
  int sm=0;
  for(i=0;i<=1000;++i){
    if(q-i>=0)
      sm+=f(p-1,q-i);
  }
  return a[p-2][q]=sm;
}
int main(){
  memset(a,-1,sizeof(a));
  int n;
  while(cin>>n)
    cout<<f(4,n)<<endl;
  return 0;
}