#include <bits/stdc++.h>
using namespace std;
int n, m, Q, sl, fh, ans, mxl[2010], mxr[2010], Ans[2010], l[2010][2010],
    r[2010][2010], f[2010][2010], up[2010][2010];
char s[2010][2010];
pair<int, int> q[2010];
int rd() {
  sl = 0;
  fh = 1;
  char ch = getchar();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') sl = sl * 10 + ch - '0', ch = getchar();
  return sl * fh;
}
int main() {
  n = rd();
  m = rd();
  Q = rd();
  int x, y;
  for (int i = 1; i <= n; ++i) scanf("%s", s[i] + 1);
  for (int i = 1; i <= Q; ++i)
    x = rd(), y = rd(), s[x][y] = 'X', q[i] = make_pair(x, y);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j)
      if (s[i][j] == '.') l[i][j] = l[i][j - 1] + 1;
    for (int j = m; j; --j)
      if (s[i][j] == '.') r[i][j] = r[i][j + 1] + 1;
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (s[i][j] == '.') {
        up[i][j] = i;
        if (up[i - 1][j]) up[i][j] = up[i - 1][j];
        f[i][j] = min(f[i - 1][j - 1] + 1, min(l[i][j], i - up[i][j] + 1));
        ans = max(ans, f[i][j]);
      }
  for (int flg, j = Q; j; --j) {
    Ans[j] = ans;
    x = q[j].first;
    y = q[j].second;
    s[x][y] = '.';
    for (int i = y; s[x][i] == '.'; ++i) l[x][i] = l[x][i - 1] + 1;
    for (int i = y; s[x][i] == '.'; --i) r[x][i] = r[x][i + 1] + 1;
    mxl[x] = l[x][y];
    mxr[x] = r[x][y];
    for (int i = x - 1; i; --i)
      mxl[i] = min(mxl[i + 1], l[i][y]), mxr[i] = min(mxr[i + 1], r[i][y]);
    for (int i = x + 1; i <= n; ++i)
      mxl[i] = min(mxl[i - 1], l[i][y]), mxr[i] = min(mxr[i - 1], r[i][y]);
    for (flg = 1; flg;) {
      flg = 0;
      ans++;
      for (int i = 0; !flg && i < ans; ++i)
        if (x > i && x + ans - i - 1 <= n &&
            min(mxl[x - i], mxl[x + ans - i - 1]) +
                    min(mxr[x - i], mxr[x + ans - i - 1]) - 1 >=
                ans)
          flg = 1;
    }
    --ans;
  }
  for (int i = 1; i <= Q; ++i) printf("%d\n", Ans[i]);
  return 0;
}
