class Calc0098 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @xp, @yp = args.shift.map(&:to_i) end def run d2 = (2 * @xp) ** 2 + (2 * @yp) ** 2 r = Math.sqrt(d2).ceil if r * r == d2 r + 1 else r end end end puts Calc0098.new(STDIN.readlines).run if __FILE__ == $0