#include <cstdio>
#include <algorithm>

#define rep(i, n) for(int i = 0; i < n; ++i)

using namespace std;

long long dp[4001][5][1001];

int main(){
	rep(i, 4001){
		for(int j = 1; j <= 4; ++j){
			rep(k, 1001){
				if(i == 0){
					dp[i][j][k] = 1;
				}
				else if(j == 1){
					dp[i][j][k] = i <= k;
				}
				else if(k == 0){
					dp[i][j][k] = 0;
				}
				else if(i > k){
					dp[i][j][k] = dp[i - 1][j][k] - dp[i - k - 1][j - 1][k] + dp[i][j - 1][k];
				}
				else{
					dp[i][j][k] = dp[i - 1][j][k] + dp[i][j - 1][k];
				}
			}
		}
	}

	int n;
	while(scanf("%d", &n) != EOF){
		printf("%lld\n", dp[n][4][1000]);
	}
	return 0;
}