#include <bits/stdc++.h>
using namespace std;

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

int dp[2020];

int main()
{
  int n;
  rep(i, 1000) rep(j, 1000){
    dp[i + j]++;
  }

  while (cin >> n){
    int ans = 0;
    rep(i, n) ans += dp[i] * dp[n - i];

    cout << ans << endl;
  }
}