#include <bits/stdc++.h>
using namespace std;
int n;
int cnt[2020];
void setcnt() {
  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i <= 1000; i++)
    for (int j = 0; j <= 1000; j++) cnt[i + j]++;
}
void solve() {
  int ans = 0;
  for (int ab = 0; ab <= n; ab++) {
    ans += cnt[ab] * cnt[n - ab];
  }
  cout << ans << endl;
}
int main() {
  setcnt();
  while (cin >> n) {
    solve();
  }
  return 0;
}
