answers = Array.new
dp = Array.new( 4 ){ Array.new( 4000 + 1 )}
0.upto( 3 ){ |i|
	0.upto( 4000 ){ |j|
		dp[ i ][ j ] = 0
	}
}
0.upto( 1000 ){ |j| 
	dp[ 0 ][ j ] = 1 
}

1.upto( 3 ){ |level|
	0.upto( 4000 ){ |i|
		0.upto( 1000 ){ |k|
			if i - k  >= 0
				dp[level][i] += dp[level-1][i-k] 
			end
		}
	}
}

while s = $stdin.gets
	answers << dp[ 3 ][ s.chomp.to_i]
end
answers.each{ |a|
	puts a
}
