import java.util.Scanner; public class No82 { public static void main (String[] args){ Scanner sc =new Scanner(System.in); int w=sc.nextInt() ,h=sc.nextInt(); boolean c=sc.next().charAt(0)=='W'; for(int i=c?1:0;i