#include <bits/stdc++.h>
int main(void) {
  int n;
  int sum1[4001];
  int sum2[4001];
  int i, j, k;
  memset(sum1, 0, sizeof(sum1));
  memset(sum2, 0, sizeof(sum1));
  for (j = 0; j <= 1000; j++) {
    sum1[j] = 1;
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j <= 1000; j++) {
      for (k = 0; k <= 4000; k++) {
        if (k + j <= 4000) {
          sum2[k + j] += sum1[k];
          if (k + j == 2) printf("[%d+%d:%d->%d]", j, k, sum1[k], sum2[k + j]);
        }
      }
    }
    memcpy(sum1, sum2, sizeof(sum1));
    memset(sum2, 0, sizeof(sum2));
  }
  while (scanf("%d", &n) != EOF) {
    printf("%d\n", sum1[n]);
  }
  return (0);
}
