class Solution {
public int solution(String word) {
int answer = 0;
char[] vowels = {'A', 'E', 'I', 'O', 'U'};
int[] interval = {781, 156, 31, 6, 1};
for (int i = 0; i < word.length(); i++) {
int index = new String(vowels).indexOf(word.charAt(i));
answer += interval[i] * index + 1;
}
return answer;
}
}