package New;
public class Prog9 {
      static int op = 0;
      public static void abc(String str)
{
            int n =
str.length();
            if (n == 8) {
                  if (str.matches("[A-Z]{3}[0-9]{4}[A-Z]{1}"))
                        op = 1;
                  else
                        op = 2;
            }
else
                  op = 2;
      }
      public static void main(String[]
args) {
            String
str = "ALD3245A";
            abc(str);
            System.out.println(op);
      }
}