#include using namespace std; typedef long long ll; typedef pair pll; typedef long double ld; typedef pair pdd; #define vec vector #define For(i, a, n) for(ll i=(ll)a;i pairoperator+(const pair&a, const pair&b){ return {a.first + b.first, a.second + b.second}; } template ostream&operator<<(ostream&os, const pair&c){ return os<<"("< basic_ostream&operator<<(basic_ostream&os, const C&c){ for(auto itr=begin(c);itr!=end(c);++itr){ os<<(itr==begin(c)?"":" ")<<*itr; } return os; } template void dbg(Args&&...args){ ((cerr<> n >> m >> q; vec v(n); For(i, 0, n) cin >> v[i]; vec time; For(i, 0, m) { ll p = 0; for(ll j = n-1; j >=0; j--) { if(v[j][i] == '*') { time.push_back((n-j)-p-1); p++; } } } sort(all(time)); vec Q; For(i, 0, q){ ll x; cin >> x; Q.push_back({x, i}); } // dbg(time); // dbg(Q); sort(all(Q)); vec ans(q); ll i = 0; time.push_back(12345678); For(j, 0, q) { while(time[i] <= Q[j].first) i++; ans[Q[j].second] = i; // dbg(Q[j].second, i); } // dbg(ans); For(i, 0, q) cout << ans[i] << '\n'; } int main(){ cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); int t = 1; while(t--)solve(); return 0; }