#include <bits/stdc++.h>
using namespace std;
int memo[5][5000];
int dfs(int n, int cnt) {
  if (n == 0) return 1;
  if (n < 0 || cnt == 4) return 0;
  if (memo[cnt][n] > 0) return memo[cnt][n];
  int ret = 0;
  for (int i = 0; i < 1001; i++) {
    ret += dfs(n - i, cnt + 1);
  }
  return memo[cnt][n] = ret;
}
int main(void) {
  int n;
  while (cin >> n) {
    int ret = dfs(n, 0);
    cout << ret << endl;
  }
  return 0;
}
