#include<bits/stdc++.h>

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)

using namespace std;

int ans[4001];

int main() {
  rep(a,1001) rep(b,1001) ++ans[a+b];
  int n;
  while( cin >> n ) {
    long long sum = 0;
    rep(i,n+1) sum += (long long)ans[i] * (long long)ans[n-i];
    cout << sum << endl;
  }
  return 0;
}