#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)

using namespace std;

typedef long long ll;

int main()
{
  int n;
  ll dp[4][4001]={};
  fill_n(dp[0],1001,1);
  FOR(i,1,3) REP(j,4001) FOR(k,0,min(j,1000)) dp[i][j] += dp[i-1][j-k];
  while(cin >> n) cout << dp[3][n] << endl;
  return 0;
}