#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int cnt[1000010];

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  for (int i = 0; i <= 1000; i++) {
    for (int j = 0; j <= 1000; j++) {
      cnt[i + j]++;
    }
  }

  int n;
  while (cin >> n) {
    int ans = 0;
    for (int i = 0; i <= n; i++) {
      ans += cnt[i] * cnt[n - i];
    }
    cout << ans << endl;
  }

  return 0;
}
