
#include<bits/stdc++.h>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)


typedef long long ll;

int n;

bool input(){
  return cin>>n;
}

ll  solve(){

  const int N = 1000;
  const int M = N*2;
  const int L = M*2;

  ll val[M+1] = {0};
  ll num[L+1] = {0};

  rep(i,N+1)rep(j,N+1)val[i+j]++;
  rep(i,M+1)rep(j,M+1)num[i+j]+=val[i]*val[j];


  //rep(i,10)printf("%d ",num[i]);puts("");

  return num[n];
}

int main(){

  while(input()){
    cout<<solve()<<endl;
  }
}