#include    <iostream>

using namespace std;

int main() {
    unsigned int pairComb[2001] = {0};
    unsigned long long abcdComb[4001] = {0};

    /* 
     * a+b+c+d=Nとなる(a,b,c,d)の組合せは，N=i+jとなる整数i,jに分割し，
     * i,jそれぞれに対し，a+b=i，c+d=jとなる(a,b)と(c,d)を同時に選ぶのと等しい．
     * すなわち，i,jを決定するのは乗法原理がなりたつ．
     * また，i+jに分割する場合は同時に選べないため，加法原理がなりたつ．
     */
    for(int i = 0; i <= 1000; i++)
        for(int j = 0; j <= 1000; j++)
            pairComb[i+j]++;
    
    for(int i = 0; i <= 2000; i++) {
        for(int j = 0; j <= i; j++) {
            abcdComb[i] += pairComb[j] * pairComb[i-j];
        }
    }
    for(int i = 2001; i <= 4000; i++) {
        for(int j = i - 2000; j <= 2000; j++) {
            abcdComb[i] += pairComb[j] * pairComb[i-j];
        }
    }

    int order;
    while(cin >> order) {
        cout << abcdComb[order] << endl;
    }

    return 0;
}

### Prompt

Generate a cpp solution to 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    <iostream>

using namespace std;

int main() {
    unsigned int pairComb[2001] = {0};
    unsigned long long abcdComb[4001] = {0};

    /* 
     * a+b+c+d=Nとなる(a,b,c,d)の組合せは，N=i+jとなる整数i,jに分割し，
     * i,jそれぞれに対し，a+b=i，c+d=jとなる(a,b)と(c,d)を同時に選ぶのと等しい．
     * すなわち，i,jを決定するのは乗法原理がなりたつ．
     * また，i+jに分割する場合は同時に選べないため，加法原理がなりたつ．
     */
    for(int i = 0; i <= 1000; i++)
        for(int j = 0; j <= 1000; j++)
            pairComb[i+j]++;
    
    for(int i = 0; i <= 2000; i++) {
        for(int j = 0; j <= i; j++) {
            abcdComb[i] += pairComb[j] * pairComb[i-j];
        }
    }
    for(int i = 2001; i <= 4000; i++) {
        for(int j = i - 2000; j <= 2000; j++) {
            abcdComb[i] += pairComb[j] * pairComb[i-j];
        }
    }

    int order;
    while(cin >> order) {
        cout << abcdComb[order] << endl;
    }

    return 0;
}

```