#include using namespace std; #define int long long void solve() { int r, c, q; cin >> r >> c >> q; vector rows(r); //cout << rows.size() << endl; for(int i = 0; i < r; i++) cin >> rows[i]; vector cetnosti(200000); //for(auto& rw : rows) //cout << rw << endl; for(int j = 0; j < c; j++) { int spaces = 0; for(int i = r - 1; i >= 0; i--) { char c = rows[i][j]; if(c == '.') { spaces++; } else { cetnosti[spaces]++; } } } // for(int i = 0; i < 20; i++) //cout << i << ": " << cetnosti[i] << endl; int done = cetnosti[0]; int next = 1; for(int i = 0; i < q; i++) { int t; cin >> t; while(t >= next) { done += cetnosti[next]; next++; } cout << done << endl; } } int32_t main() { ios::sync_with_stdio(false); cin.tie(0); solve(); return 0; }