class A def initialize r, c = gets.chomp.split(' ').map(&:to_i) if r != c 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 else if c.even? n = c/2 puts (n/2.0 * (1.0 + (2 * n - 1))).to_i - 1 else if c == 1 puts 1 else n = c/2 puts (n/2.0 * (2.0 + 2.0 * n)).to_i end end end end end A.new