 encoding: utf-8                                                            

def solve2 n
  n + 1
end

def solve n
  ans = 0
  (0..[2000, n].min).each do |k|
    if n - k <= 2000
      ans += solve2(k) * solve2(n - k)
    end
  end
  ans
end

while n = gets
  n = n.rstrip.to_i
  puts "#{solve(n)}"
end