class A def initialize r, c = gets.chomp.split(' ').map(&:to_i) if c.even? puts (r * (c/2)) - 1 else if r.even? puts (r * (c/2) + (r/2)) - 1 else puts (r * (c/2) + (r/2)+1) - 1 end end end end A.new