#include #include int main() { int n, m, q; std::cin >> n >> m >> q; std::string flakes[n]; for (std::string &row : flakes) std::cin >> row; int times[q]; for (auto & time : times) std::cin >> time; // std::cout << "FLAKES:\n"; // for (const std::string &row : flakes) // std::cout << row << '\n'; // // std::cout << "TIMES:\n"; // for (auto time : times) // std::cout << time << '\n'; // // std::cout << "result:\n"; for (int time_t = 0; time_t < q; time_t++) { int result = 0; std::vector tmp_height(m, 0); for (int row = n - 1; row >= 0; row--) { for (int col = 0; col < m; col++) { if (flakes[row][col] == '*') { int height = n - 1 - row - tmp_height[col]; if (height <= times[time_t]) { result++; tmp_height[col]++; } } } } std::cout << result << '\n'; } return 0; }