#!/usr/bin/env ruby

def max_plus(v1, v2)
  if v1 <= 1 && 1 <= v2
    return 1
  elsif v1 <= -1 && -1 <= v2
    return -1
  elsif v1 == 0 && v2 == 0
    return 0
  elsif v1 >= 1 and v2 >= 1
    return v1
  else
    return v2
  end
end

i = gets
a, b, c, d = i.chomp.split(" ").map(&:to_i)
x = (a > b) ? a : b
y = (c > d) ? c : d
if x == 0 && (a < 0 || b < 0)
  x = -1
elsif y == 0 && (c < 0 || d < 0)
  y = -1
end

x = max_plus(a, b) if y <= -1
y = max_plus(c, d) if x <= -1

puts x*y