#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e3 + 10;
int s[maxn][maxn];
int L[maxn][maxn], R[maxn][maxn];
bool G[maxn][maxn];
int curAns;
int ans[maxn];
int x[maxn], y[maxn];
char ch[maxn];
int ll[maxn], rr[maxn];
int main() {
  int n, k, m;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%s", ch);
    for (int j = 1; j <= m; j++)
      if (ch[j - 1] == '.') G[i][j] = 1;
  }
  for (int i = 1; i <= k; i++) {
    scanf("%d%d", &x[i], &y[i]);
    G[x[i]][y[i]] = 0;
  }
  curAns = 0;
  for (int i = 0; i <= n + 1; i++)
    for (int j = 0; j <= m + 1; j++) s[i][j] = 1 - G[i][j];
  for (int i = 0; i <= n + 1; i++)
    for (int j = 1; j <= m + 1; j++) s[i][j] += s[i][j - 1];
  for (int i = 1; i <= n + 1; i++)
    for (int j = 0; j <= m + 1; j++) s[i][j] += s[i - 1][j];
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      while (i + curAns <= n && j + curAns <= m &&
             s[i + curAns][j + curAns] + s[i - 1][j - 1] ==
                 s[i + curAns][j - 1] + s[i - 1][j + curAns])
        curAns++;
  for (int i = 0; i <= n + 1; i++) {
    for (int j = 0; j <= m + 1; j++)
      if (G[i][j] == 0)
        L[i][j] = j;
      else
        L[i][j] = L[i][j - 1];
    for (int j = m + 1; j >= 0; j--)
      if (G[i][j] == 0)
        R[i][j] = j;
      else
        R[i][j] = R[i][j + 1];
  }
  for (int i = k; i >= 1; i--) {
    ans[i] = curAns;
    int xx = x[i], yy = y[i];
    G[xx][yy] = 0;
    for (int j = y[i]; R[xx][j] == yy; R[xx][j] = R[xx][yy + 1], j--)
      ;
    for (int j = y[i]; L[xx][j] == yy; L[xx][j] = L[xx][yy - 1], j++)
      ;
    ll[xx] = L[xx][yy];
    rr[xx] = R[xx][yy];
    for (int j = xx - 1; j >= 0; j--) {
      ll[j] = max(L[j][yy], ll[j + 1]);
      rr[j] = min(R[j][yy], rr[j + 1]);
    }
    for (int j = xx + 1; j <= n + 1; j++) {
      ll[j] = max(L[j][yy], ll[j - 1]);
      rr[j] = min(R[j][yy], rr[j - 1]);
    }
    while (1) {
      int ok = 0;
      for (int j = xx; j <= n; j++) {
        if (j - curAns > xx) break;
        if (j - curAns < 0) continue;
        if (min(rr[j], rr[j - curAns]) - max(ll[j], ll[j - curAns]) - 1 >=
            curAns + 1) {
          ok = 1;
          break;
        }
      }
      if (ok)
        curAns++;
      else
        break;
    }
  }
  for (int i = 1; i <= k; i++) printf("%d\n", ans[i]);
  return 0;
}
