A string consisting of
lowercase latin characters is hashed using the following method:
is the ASCII value of the
(one-indexed) character of string
.
and
are values given to you.
Given a string , and integers
and
, can you calculate
?
Input Specification
The first line will contain the integer
.
The second line will contain the string of length
.
will only contain lowercase latin characters.
The third line will contain the integers and
.
Output Specification
Output .
Sample Input
3
aaa
2 1
Sample Output
0
Comments