_ = gets
x, y = 0, 0
gets.chomp.each_char do |c|
  dx, dy =
    (?A..?M) === c ? [0, 1] :
    (?N..?Z) === c ? [0, -1] :
    (?a..?m) === c ? [1, 0] :
                     [-1, 0]
  x += dx
  y += dy
end
s = (x < 0 ? ?z * -x : ?a * x) + (y < 0 ? ?Z * -y : ?A * y)
p s.size
puts s
