subly-goes-binary-2

Subly went to meet the Chef. As the Chef gets a lot of problems from his friends, he wants Subly to help him find a good programmer. 

Subly is given a Binary String and a positive integer k. He has to count the number of sub strings of length k, whose value in Decimal is divisible by 4.

Two sub strings are unique if their starting and ending positions in the original string are different. Two unique sub strings may have same value.

Input:

First line contains a Number N, denoting length of the string, 

Second line contains the String.

Third line contains a number Q, denoting the number of queries. 

Then, there are Q numbers in each line, call it k, denoting the length of the sub string.

Output:

Print answer to each query in a new line.

Constraints:

1 ≤ N ≤ 100000

1 ≤ Q ≤ 100000

2 ≤ k ≤ N

The string contains '0' and '1' only.
Register for IndiaHacksSAMPLE INPUT
10
0110010100
7
8
4
7
2
3
10
4

SAMPLE OUTPUT
1
2
1
2
2
1
2

Register for IndiaHacks

Source: hackerearth | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
n=eval(input())
s=input()
q=eval(input())
for j in range(q):
	ans=0
	k=eval(input())
	for i in range(n-k+1):
		if s[i+k-2:i+k]=='00':
			ans+=1
	print(ans)


n=eval(input())
s=input()
q=eval(input())
for j in range(q):
	ans=0
	k=eval(input())
	for i in range(n-k+1):
		if s[i+k-2:i+k]=='00':
			ans+=1
	print(ans)


'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
N = eval(input())
string = input()
query = eval(input())
n = len(string)
while query != 0:
	count = 0
	l = eval(input())
	j = l - 1
	while j < n:
		if string[j]=='0' and string[j - 1] == '0':
			count += 1
		j += 1
	print(count)
	query -= 1