while gets
  num,count=$_.to_i,0
  (0..1000).each do |a|
    (0...1000).each do |b|
      (0...1000).each do |c|
        (0...1000).each do |d|
          if a+b+c+d==num then
            count+=1
            break
          end
          break if d>num
        end
        break if c>num
      end
      break if b>num
    end
    break if a>num
  end
  puts count
end