#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 24;
const int N = 4001;
const int M = 1001;
int dp[5][N];
int main(void) {
  for (int i = 0; i < 5; i++) fill(dp[i], dp[i] + N, 0);
  dp[0][0] = 1;
  for (int i = 1; i <= 4; i++)
    for (int j = 0; j < N; j++)
      if (dp[i - 1][j])
        for (int k = 0; k < M; k++) dp[i][j + k] += dp[i - 1][j];
  for (int n; cin >> n; cout << dp[n] << endl)
    ;
  return 0;
}
