#include <bits/stdc++.h>
using namespace std;
int main() {
  int dp[9][5000] = {};
  for (int i = 1; i <= 1000; i++) dp[1][i] = 1;
  for (int i = 1; i <= 2; i++)
    for (int j = 1; j <= 1000 * i; j++)
      for (int k = 1; k <= 1000 * i; k++)
        dp[i * 2][j + k] += dp[i][j] * dp[i][k];
  for (int n; cin >> n;) cout << dp[4][n] << endl;
  return 0;
}
