JOI Laboratory has
- if
, the color of the -th part of the poisonous snake from the head is blue, and - if
, the color of the -th part of the poisonous snake from the head is red.
Each poisonous snake has an integer between
Since poisonous snakes are quick, they often escape from JOI Laboratory. Complaints are given to JOI Laboratory by people living near the laboratory who saw poisonous snakes escaping from the laboratory.
You are given a list of complaints for 0
, 1
, ?
.
- If the
-th character ( ) of is0
, this means the -th part of every poisonous snake escaping from the laboratory on the -th day is blue, - If the
-th character ( ) of is1
, this means the -th part of every poisonous snake escaping from the laboratory on the -th day is red, and - If the
-th character ( ) of is?
, this means no information was given by people concerning the -th part of poisonous snakes escaping from the laboratory on the -th day.
All the complaints are precise information. All the poisonous snakes escaping from the laboratory were kept by the staff of JOI Laboratory on the same day. It may happen that the same snake escapes on a different day.
In order to estimate the risk of escaping poisonous snakes, Professor K, the executive director of JOI Laboratory, wants to know the sum of toxicities of the snakes which might escape from the laboratory. Your task is to write a program which calculates, given the list of complaints for
Input Specification
The first line contains two space separated integers
The second line contains a string
Each of the following
Output Specification
Write
Constraints
In all test cases,
, is a string of length and consists of digits from to is a string of length and consists of0
,1
, and?
.
In
In another
In another
In another
Sample Input 1
3 5
12345678
000
0??
1?0
?11
???
Sample Output 1
1
10
12
12
36
Sample Input 2
4 8
3141592653589793
0101
?01?
??1?
?0??
1?00
01?1
??10
????
Sample Output 2
9
18
38
30
14
15
20
80
Comments