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

    prefix = []
    s = 0
    current_val = None
    for t in sorted(time_to_fall):
        if current_val is None:
            current_val = t

        if t == current_val:
            s += 1
        else:
            prefix.append( prefix[-1] + s if len(prefix) > 0 else s )
            s = 1
            current_val = t
    
    prefix.append( prefix[-1] + s if len(prefix) > 0 else s )
    return prefix

prefix = precompute(grid)

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