#include <cstdio>

using namespace std;
typedef long long lint;


int main()
{
	int n;
	
	while (scanf("%d", &n) == 1){
		lint tbl[2001] = {0};
		
		for (int i = 0; i <= 1000; i++)
			for (int j = 0; j <= 1000; j++)
				tbl[i + j]++;
		
		lint ans = 0;
		for (int i = 0; i <= 2000; i++)
			for (int j = 0; j <= 2000; j++)
				if (i + j == n) ans += tbl[i] * tbl[j];
		
		printf("%lld\n", ans);
	}
	
	return (0);
}