#include <bits/stdc++.h>
using namespace std;
const int N = 2003;
const int NN = 10000;
const int oo = 1e9;
int sz, n, m, an[N], up[N][N], l[N][N], r[N][N], trl[N][NN], trr[N][NN],
    st[N][2];
bool g[N][N];
char s[N];
set<pair<int, int> > hl, hr;
void change(int *a, int i, int c) {
  i += sz;
  a[i] = c;
  for (i >>= 1; i; i >>= 1) a[i] = min(a[i << 1], a[(i << 1) | 1]);
}
int get(int *a, int l, int r) {
  int an = oo;
  for (l += sz, r += sz; l <= r; l >>= 1, r >>= 1) {
    if (l & 1) an = min(an, a[l++]);
    if (!(r & 1)) an = min(an, a[r--]);
  }
  return an;
}
void check(int j, int &ans) {
  bool fl;
  int i, i2, t1, t2;
  for (++ans; ans <= n; ++ans) {
    fl = false;
    hl.clear();
    for (i = 0; (i + ans - 1 < n) && !fl; ++i) {
      i2 = i + ans - 1;
      if (up[i2][j] >= ans) {
        t1 = get(trl[j], i, i2);
        t2 = get(trr[j], i, i2);
        if (t1 + t2 - 1 >= ans) {
          fl = true;
        }
      }
    }
    if (!fl) break;
  }
  --ans;
}
int main() {
  if (0) {
    freopen("input.txt", "w", stdout);
    int i, j, n, m, k;
    n = m = 2000;
    k = 1;
    printf("%d %d %d\n", n, m, k);
    for (i = 0; i < n; ++i) {
      for (j = 0; j < m; ++j) printf(".");
      printf("\n");
    }
    printf("1 1\n");
    return 0;
  }
  int i, j, u, k, ans;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 0; i < n; ++i) {
    scanf("%s", s);
    for (j = 0; j < m; ++j) g[i][j] = (s[j] == '.');
  }
  for (u = 0; u < k; ++u) {
    scanf("%d%d", &i, &j);
    --i;
    --j;
    g[i][j] = false;
    st[u][0] = i;
    st[u][1] = j;
  }
  for (sz = 1; sz < n; sz <<= 1)
    ;
  for (i = 0; i < n; ++i) {
    l[i][0] = g[i][0];
    for (j = 1; j < m; ++j) l[i][j] = (l[i][j - 1] + 1) * g[i][j];
    r[i][m - 1] = g[i][m - 1];
    for (j = m - 2; j >= 0; --j) r[i][j] = (r[i][j + 1] + 1) * g[i][j];
  }
  for (j = 0; j < m; ++j) {
    up[0][j] = g[0][j];
    for (i = 1; i < n; ++i) up[i][j] = (up[i - 1][j] + 1) * g[i][j];
  }
  for (j = 0; j < m; ++j) {
    for (i = 0; i < n; ++i) trl[j][i + sz] = l[i][j], trr[j][i + sz] = r[i][j];
    for (i = n; i < sz; ++i) trl[j][i + sz] = trr[j][i + sz] = oo;
    for (i = sz - 1; i; --i)
      trl[j][i] = min(trl[j][i << 1], trl[j][(i << 1) | 1]);
    for (i = sz - 1; i; --i)
      trr[j][i] = min(trr[j][i << 1], trr[j][(i << 1) | 1]);
  }
  ans = 0;
  for (j = 0; j < m; ++j) {
    check(j, ans);
  }
  for (u = k - 1; u >= 0; --u) {
    an[u] = ans;
    i = st[u][0];
    j = st[u][1];
    g[i][j] = true;
    l[i][0] = g[i][0];
    for (j = 1; j < m; ++j) l[i][j] = (l[i][j - 1] + 1) * g[i][j];
    r[i][m - 1] = g[i][m - 1];
    for (j = m - 2; j >= 0; --j) r[i][j] = (r[i][j + 1] + 1) * g[i][j];
    for (j = 0; j < m; ++j)
      change(trl[j], i, l[i][j]), change(trr[j], i, r[i][j]);
    j = st[u][1];
    up[0][j] = g[0][j];
    for (i = 1; i < n; ++i) up[i][j] = (up[i - 1][j] + 1) * g[i][j];
    check(j, ans);
  }
  for (u = 0; u < k; ++u) printf("%d\n", an[u]);
  return 0;
}
