class Dot
  attr_accessor :x, :y, :dir
  def initialize(x, y, direction = nil)
    @x = x.to_i
    @y = y.to_i
    @dir = direction
  end
end

class Way
  attr_accessor :x, :dx
  def initialize(x, dx)
    @x = x
    @dx = dx
  end
end

N = gets.chop.to_i
dots = []
N.times do 
  x, y, dir = gets.chop.split
  dots << Dot.new(x, y, dir)
end

rights = dots.select { |d| d.dir == "R"}
lefts = dots.select { |d| d.dir == "L"}
ups = dots.select { |d| d.dir == "U"}
downs = dots.select { |d| d.dir == "D"}

x_way = []
unless rights.empty?
  if rights.size == 1
    x_way << Way.new(rights[0].x, 1)
  else
    x_way << Way.new(rights.max_by(&:x).x, 1)
    x_way << Way.new(rights.min_by(&:x).x, 1)
  end
end
unless lefts.empty?
  if lefts.size == 1
    x_way << Way.new(lefts[0].x, -1)
  else
    x_way << Way.new(lefts.max_by(&:x).x, -1)
    x_way << Way.new(lefts.min_by(&:x).x, -1)
  end
end

x_flat = ups + downs
unless x_flat.empty?
  if x_flat.size == 1
    x_way << Way.new(x_flat[0].x, 0)
  else
    x_way << Way.new(x_flat.max_by(&:x).x, 0)
    x_way << Way.new(x_flat.min_by(&:x).x, 0)
  end
end

y_way = []
unless ups.empty?
  if ups.size == 1
    y_way << Way.new(ups[0].y, 1)
  else
    y_way << Way.new(ups.max_by(&:y).y, 1)
    y_way << Way.new(ups.min_by(&:y).y, 1)
  end
end
unless downs.empty?
  if downs.size == 1
    y_way << Way.new(downs[0].y, -1)
  else
    y_way << Way.new(downs.max_by(&:y).y, -1)
    y_way << Way.new(downs.min_by(&:y).y, -1)
  end
end

y_flat = lefts + rights
unless y_flat.empty?
  if y_flat.size == 1
    y_way << Way.new(y_flat[0].y, 0)
  else
    y_way << Way.new(y_flat.max_by(&:y).y, 0)
    y_way << Way.new(y_flat.min_by(&:y).y, 0)
  end
end

times = [0.0]
x_way.combination(2) do |a, b|
  next if a.dx == b.dx
  time = ((a.x - b.x) * -1.0) / (a.dx - b.dx)
  next if time < 0
  times << time
end

y_way.combination(2) do |a, b|
  next if a.dx == b.dx
  time = ((a.x - b.x) * -1.0) / (a.dx - b.dx)
  next if time < 0
  times << time
end

ans = 10**100
times.each do |t|
  x_max = x_way.map { |w| w.x + w.dx * t }.max * 1.0
  x_min = x_way.map { |w| w.x + w.dx * t }.min * 1.0
  y_max = y_way.map { |w| w.x + w.dx * t }.max * 1.0
  y_min = y_way.map { |w| w.x + w.dx * t }.min * 1.0
  ans = [ans, (x_max - x_min) * (y_max - y_min)].min
end

puts ans
