#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
int n, m, k, xx[N], yy[N], a[N][N], up[N][N], down[N][N], fans[N];
int query(int x) {
  int ans = 0, il = 1;
  deque<int> d1, d2;
  for (int i = 1; i <= m; ++i) {
    if (!d1.empty())
      while (up[x][i] < up[x][d1.back()]) {
        d1.pop_back();
        if (d1.empty()) break;
      }
    if (!d2.empty())
      while (down[x][i] < down[x][d2.back()]) {
        d2.pop_back();
        if (d2.empty()) break;
      }
    d1.push_back(i);
    d2.push_back(i);
    ans =
        max(ans, min(up[x][d1.front()] + down[x][d2.front()] - 1, i - il + 1));
    while (up[x][d1.front()] + down[x][d2.front()] - 1 < i - il + 1) {
      ++il;
      if (d1.front() == il - 1) d1.pop_front();
      if (d2.front() == il - 1) d2.pop_front();
      if (d1.empty() || d2.empty()) break;
      ans = max(ans,
                min(up[x][d1.front()] + down[x][d2.front()] - 1, i - il + 1));
    }
  }
  return ans;
}
void update(int y) {
  for (int i = 1; i <= n; ++i) up[i][y] = a[i][y] == 0 ? up[i - 1][y] + 1 : 0;
  for (int i = n; i >= 1; --i)
    down[i][y] = a[i][y] == 0 ? down[i + 1][y] + 1 : 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < m; ++j) a[i][j + 1] = s[j] == '.' ? 0 : 1;
  }
  for (int i = 1; i <= k; ++i) {
    cin >> xx[i] >> yy[i];
    a[xx[i]][yy[i]] = 1;
  }
  for (int i = 1; i <= m; ++i) update(i);
  int ans = 0;
  for (int i = 1; i <= n; ++i) ans = max(ans, query(i));
  for (int i = k; i >= 1; --i) {
    fans[i] = ans;
    a[xx[i]][yy[i]] = 0;
    update(yy[i]);
    ans = max(ans, query(xx[i]));
  }
  for (int i = 1; i <= k; ++i) cout << fans[i] << '\n';
}
