#include #include using namespace std; #define FF(x, y, z) for(int x =y; x < z; x++) vector> snows; int N, M, Q; int sum_snow(int t) { int res = 0; FF(x, 0, M) { int left = t; for (int y = N-1; y >= 0; y--) { if (snows[y][x] == '.') { left--; if (left < 0) break; } if (snows[y][x] == '*' && left >= 0) res++; } } return res; } int main() { cin >> N >> M >> Q; snows.resize(N); FF(y, 0, N) { snows[y].resize(M); FF(x, 0, M) { char c; cin >> c; snows[y][x] = c; } } FF(i, 0, Q) { int t; cin >> t; cout << sum_snow(t) << endl; } return 0; }