#include<iostream>

using namespace std;

int main(){
	int n, a, b, c, d, num;
	while (cin >> n){
		num = 0;

		int max = (n <= 1000) ? n : 1000;

		for (a = max; a >= 0; --a){

			if (n - a <= 3000){
				for (b = max; b >= 0; --b){


					if (n - a - b <= 2000){
						for (c = max; c >= 0; --c){

							if (n - a - b - c <= 1000){
								for (d = max; d >= 0; --d){
									if (a + b + c + d == n)
										++num;
								}
							}

						}
					}

				}
			}
		}
		cout << num << endl;

	}

	return 0;
}