/******************************************************************/
/* ACM ICPC 2017-2018, NEERC                                      */
/* Northern Subregional Contest                                   */
/* St Petersburg, November 4, 2017                                */
/******************************************************************/
/* Problem C. Consonant Fencity                                   */
/*                                                                */
/* Original idea         Andrei Lopatin                           */
/* Problem statement     Andrei Lopatin                           */
/* Test set              Andrei Lopatin                           */
/******************************************************************/
/* Checker                                                        */
/*                                                                */
/* Author                Andrei Lopatin                           */
/******************************************************************/

import java.util.*;
import ru.ifmo.testlib.Checker;
import ru.ifmo.testlib.InStream;
import ru.ifmo.testlib.Outcome;

import static ru.ifmo.testlib.Outcome.Type.OK;
import static ru.ifmo.testlib.Outcome.Type.WA;
import static ru.ifmo.testlib.Outcome.Type.FAIL;



public class Check implements Checker {
  static final int K = 19;
  static final String z = "bcdfghjklmnpqrstvxzwyaeiou";

  int fencity (String s) {
    int ans = 0;
    String ls = s.toLowerCase ();
    int prev = z.indexOf (ls.charAt (0));
    for (int i = 1; i < s.length (); i++) {
      int cur = z.indexOf (ls.charAt (i));
      if (prev < K && cur < K) {
        ans += ((s.charAt (i - 1) ^ s.charAt (i)) & 32) != 0 ? 1 : 0;
      }
      prev = cur;
    }
    return ans;
  }
  
    public Outcome test(InStream inf, InStream ouf, InStream ans) {
        String user = ouf.nextLine();
        String jury = ans.nextLine();
        if (!user.toLowerCase ().equals (jury.toLowerCase ()))
          return new Outcome(WA, "Strings differ");
        int z[] = new int [26];
        Arrays.fill (z, -1);
        for (int i = 0; i < user.length (); i++) {
          int a = (user.charAt (i) & 31) - 1;
          int t = user.charAt (i) > 96 ? 1 : 0;
          if (z[a] < 0) z[a] = t;
          if (z[a] != t)
            return new Outcome (WA, "Letter " + user.charAt (i) + " in both cases");
        }
        int uf = fencity (user);
        int jf = fencity (jury);
        if (uf < jf)
          return new Outcome (WA, "Contestant's answer is less than jury: " + uf + " < " + jf);
        if (uf > jf)
          return new Outcome (FAIL, "Contestant's answer is greater than jury: " + uf + " > " + jf);
        return new Outcome (OK, "Fencity is " + uf);
    }
}

