import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = 26,k=0,area=0; int h[] = new int[n]; for(int h_i=0; h_i < n; h_i++){ h[h_i] = in.nextInt(); } String word = in.next(); int l = word.length(); for (int i = 0 ; i != word.length() ; i++) { char c = word.charAt(i); if(c =='j' || c =='k' || c =='l' || c =='m' || c =='n' || c =='o' || c =='p' || c =='q' || c =='r' || c =='s' || c =='t' || c =='u' || c =='v' || c =='w' || c =='x' || c =='y' || c =='z'){ k = 5; area = k * l; break; } else if( c=='b' || c=='d' || c=='h') { k=3; area = k*l; break; } else if(c=='f') { k=4; area = k*l; break; } else if(c=='i'){ k=2; area = k*l; break; } else { k=1; area=l; } } System.out.println(area); } }