#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

signed main(void)
{
  int n;
  while(cin >> n) {
    int a[5010] = {0};
    REP(i, 1001) REP(j, 1001) {
      a[i+j]++;
    }
    int ret = 0;
    REP(i, 1001) REP(j, 1001) {
      if(i+j <= n) {
        ret += a[n-i-j];
      }
    }
    cout << ret << endl;
  }

  return 0;
}
### Prompt

Create a solution in Cpp for the following problem:

Enter a positive integer n of 4,000 or less, with a pair of integers a, b, c, d in the range 0-1000.


a + b + c + d = n


Create a program that outputs the number of combinations that satisfy the conditions.



Input

Given multiple datasets. Each dataset is given n on one row. Please process until the end of the input.

The number of datasets does not exceed 50.

Output

For each data set, output the number of combinations of a, b, c, and d on one line.

Example

Input

2
3
35


Output

10
20
8436

### Response

```cpp
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
#define int ll

signed main(void)
{
  int n;
  while(cin >> n) {
    int a[5010] = {0};
    REP(i, 1001) REP(j, 1001) {
      a[i+j]++;
    }
    int ret = 0;
    REP(i, 1001) REP(j, 1001) {
      if(i+j <= n) {
        ret += a[n-i-j];
      }
    }
    cout << ret << endl;
  }

  return 0;
}
```