r, c, q = [int(x) for x in input().split()]

sky = []

first_occur = [c for x in range(c)]
remaing = 0
for row in range(r):
    line = input()
    sky_row = []
    for column in range(c):
        if(line[column] == "*" and row < first_occur[column]):
            first_occur[column] = row
            remaing +=1
        sky_row.append(line[column] == "*")
    sky.append(sky_row)


days = []
day_i = 0
for day in range(q):
    days.append(int(input()))

snow = 0
day = -1
index_in_column=[r for x in range(c)]
while 1: #remaing and q
    day += 1
    for j in range(len(index_in_column)):
        index_in_column[j] -= 1
        while index_in_column[j] > -1 and sky[index_in_column[j]][j] == 1:
            snow += 1
            if index_in_column[j] == first_occur[j]:
                remaing -= 1
            index_in_column[j]-=1
    #print(day, "-----", snow, index_in_column)
    if day_i == len(days):
        break
    if days[day_i] == day:
        print(snow)
        day_i += 1
    if remaing == 0:
        while(day_i != len(days)):
            print(snow)
            day_i += 1
    #if day_i == len(days):
    #    break


        """
 0 ----- 2 [3, 3, 3, 1]
2
1 ----- 4 [1, 2, 2, -1]
2 ----- 7 [-1, -1, 1, -2]
7
3 ----- 8 [-2, -2, -1, -3]
4 ----- 8 [-3, -3, -2, -4]
5 ----- 8 [-4, -4, -3, -5]
8

        """
"""
0 ----- 1 [2, 2, 1, 2, 2]
1
1 ----- 4 [1, -1, -1, 1, 1]
4
2 ----- 7 [-1, -2, -2, -1, -1]
7
3 ----- 7 [-2, -3, -3, -2, -2]
7
4 ----- 7 [-3, -4, -4, -3, -3]
5 ----- 7 [-4, -5, -5, -4, -4]
6 ----- 7 [-5, -6, -6, -5, -5]
7 ----- 7 [-6, -7, -7, -6, -6]
8 ----- 7 [-7, -8, -8, -7, -7]
9 ----- 7 [-8, -9, -9, -8, -8]
10 ----- 7 [-9, -10, -10, -9, -9]
7
"""