start = Time.now
N = gets.to_i
XYD = $<.map{|s|
  x, y, d = s.split
  [x.to_i, y.to_i, d.intern]
}
f = ->n{
  tbl = {
    R: [1, 0],
    L: [-1, 0],
    U: [0, 1],
    D: [0, -1],
  }
  min_x = min_y = 1.0/0
  max_x = max_y = -1.0/0
  XYD.each{|x, y, d|
    mul_x, mul_y = tbl[d]
    x += n * mul_x
    y += n * mul_y
    min_x = x if x < min_x
    max_x = x if x > max_x
    min_y = y if y < min_y
    max_y = y if y > max_y
  }
  (max_x - min_x) * (max_y - min_y)
}

l = 0.0
r = 3e8
100.times{|i|
  if f[(l * 2 + r) / 3] < f[(l + r * 2) / 3]
    r = (l + r * 2) / 3
  else
    l = (l * 2 + r) / 3
  end
  break if Time.now - start > 4.9
}
p f[(l + r) / 2]