#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const double INF = 1e12, EPS = 1e-9;
int n, dp[2010];
int main() {
  for (int i = 0; i < (int)1001; i++)
    for (int j = 0; j < (int)1001; j++) dp[i + j]++;
  while (cin >> n) {
    long long ans = 0;
    for (int i = 0; i < (int)n + 1; i++) ans += (long long)dp[i] * dp[n - i];
    cout << ans << endl;
  }
  return 0;
}
