from collections import Counter

def line_ints(): return list(map(int, input().split()))

n, m, q = line_ints()

grid = []

for i in range(n):
    grid.append(input())

Ts = []
for _ in range(q):
    Ts.append( int(input()) )

def precompute(grid):
    
    time_to_fall = []
    
    for j in range(m):
        next_snow = n - 1
        for i in range( n - 1, -1, -1 ):
            if grid[i][j] == "*":
                if next_snow == n - 1:
                    time_to_fall.append( (n - 1) - i )
                else:
                    time_to_fall.append(next_snow - i)
                next_snow -= 1

    if len(time_to_fall) > 0:
        prefix = [0 for _ in range(max(time_to_fall) + 1)]
    else:
        return []
    
    c = Counter(time_to_fall)

    prefix = []
    for t in range(0, max(time_to_fall) + 1):
        to_add = c[t] if t in c else 0
        prefix.append( prefix[-1] + to_add if t != 0 else to_add )

    return prefix


prefix = precompute(grid)

for t in Ts:
    if len(prefix) == 0:
        print(0)
    elif t >= len(prefix):
        print( prefix[-1] )
    else:
        print(prefix[t])
