#include <iostream>
#include <vector>

int main() {
    const int MAXTIME = 1e5+7;
    int n, m, q;
    std::cin >> n >> m >> q;
    char c;
    int arr[n+7][m+7];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            std::cin >> c;
            if(c == '.') arr[i][j] = 0;
            else arr[i][j] = 1;
        }
    }

    std::vector<int> below_cnt(m, 0);
    std::vector<int> falltime_cnt(MAXTIME, 0);
    for(int i = n-1; i >=0; i-- ){
        for(int j = 0; j < m; j++){
            if(arr[i][j] == 1){
                int falltime = n-1 - i - below_cnt[j];
                falltime_cnt[falltime]++;
                below_cnt[j]++;
            }
        }
    }
    std::vector<int> prefsum(MAXTIME, 0);
    prefsum[0] = falltime_cnt[0];
    for(int i = 1; i< MAXTIME; i++){
        prefsum[i] = prefsum[i-1] + falltime_cnt[i];
    }

    int time;
    while(q--){
        std::cin >> time;
        std::cout << prefsum[time];
        if (q != 0)
            std::cout << "\n";
    }

    return 0;
}
