#include #include #include using namespace std; int main() { int height, width, q; cin >> height >> width >> q; vector> field; field.reserve(height); for (int i = 0; i < height; i++) { string str; cin >> str; field.emplace_back(); for (int j = 0; j < width; j++) { field[i].push_back(false); } for (int j = 0; j < str.size(); j++) { if (str[j] == '*') { field[i][j] = true; } } } vector queries; for (int i = 0; i < q; i++) { int step; cin >> step; queries.push_back(step); } for (int query : queries) { int count = 0; for (int x = 0; x < width; x++) { int current_life = 0; for (int y = height - 1; y >= 0; y--) { if (field[y][x]) { if (current_life <= query) { count++; } } else { current_life++; } } } cout << count << '\n'; } return 0; }