내꺼

import java.util.*;

class Solution {
    private static final char[] CHARS = {'A','E','I','O','U'};
    private static String targetWord;
    private static StringBuilder w = new StringBuilder();
    private static int count = 0;
    private static boolean isContinue = true;
    public int solution(String word) {
        targetWord = word;
        solve(0);
        return count;
    }
    
    private static void solve(int depth){
        if(w.toString().equals(targetWord)){
            isContinue = false;
            return;
        }
        
        if(depth == 5){
            return;
        }
        
        for(int i=0 ; i<5 ; i++){
            w.append(CHARS[i]);
            ++count;
            //System.out.println(w.toString());
            solve(depth+1);
            if(!isContinue) return;
            w.deleteCharAt(w.length()-1);
        }
    }
}