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 h[] = new int[26]; int height=1, high=1, width=1, area=1, temp=1; for(int h_i=0; h_i < 26; h_i++){ h[h_i] = in.nextInt(); //if(h_i!=0) // high = (h[h_i]>h[h_i - 1])? h_i:(h_i - 1); //else // high = h_i; } //System.out.println("high"+high); String word = in.next(); //System.out.println("word"+word); width = word.length(); //System.out.println("width"+width); for(int i=0;ih[i-1])? h[i]:h[i-1]; } //System.out.println("height"+height); area = width*height; System.out.println(area); } }