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