package no082; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); char c = sc.next().charAt(0); int k = c == 'B' ? 0 : 1; for(int i=0;i