Plz, help me with this? Write this code with java.
Our smart friend Ali build a game in this game, the phone's screen is divided into four vertical strips, each second, a black square appear on some of the strips, according to the rules of the game, Ali must use this second to touch the corresponding strip to make the square go away, as Ali is both smart and lazy, he counted that he wastes exactly ai calorie on touching the i_th strip. You have got a string s, describing the process of the game and numbers a, a2,a3,a4 calculate how many calories Ali need to destroy all the square? INPUT The first input contain four integers a1,a2,a3,a4. The second line contains string s, where the i_th character of the string equal "1", if on the i_th second of the game the square on appears on the first strip," 2" if it appears on the second strip, "3" if it appears on the third strip, "4" if it appears on the fourth strip, he second input contains number of clicks. OUTPUT Print a string integer--- the total number of calories that Ali wastes.