#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x * 10 + ch - '0');
    ch = getchar();
  }
  return x * f;
}
char ch[2005];
int n, m, k;
struct st {
  int x, y;
} q[2005];
int ans[2005];
int a[2005][2005], dp[2005][2005], up[2005][2005], down[2005][2005];
int now;
int p1[2005], p2[2005];
int get_ans(int far, int x, int y) {
  int L = y, R = y;
  while (L > 1 && a[x][L - 1] == 0) L--;
  while (R < m && a[x][R + 1] == 0) R++;
  int num = 0;
  if (R - L + 1 < far) return 0;
  memset(p1, 0, sizeof p1);
  memset(p2, 0, sizeof p2);
  int l1 = 1, r1 = 0, l2 = 1, r2 = 0;
  for (int i = L; i <= L + far - 1; i++) {
    while (l1 <= r1 && up[x][i] <= up[x][p1[r1]]) r1--;
    while (l2 <= r2 && down[x][i] <= down[x][p2[r2]]) r2--;
    p1[++r1] = i;
    p2[++r2] = i;
  }
  if (up[x][p1[l1]] + down[x][p2[l2]] - 1 >= far) return 1;
  for (int i = L + far; i <= R; i++) {
    if (i - p1[l1] + 1 > far) l1++;
    if (i - p2[l2] + 1 > far) l2++;
    while (l1 <= r1 && up[x][i] <= up[x][p1[r1]]) r1--;
    while (l2 <= r2 && down[x][i] <= down[x][p2[r2]]) r2--;
    p1[++r1] = i;
    p2[++r2] = i;
    if (up[x][p1[l1]] + down[x][p2[l2]] - 1 >= far) return 1;
  }
  return 0;
}
signed main() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%s", ch + 1);
    for (int j = 1; j <= m; j++) {
      if (ch[j] != '.') {
        a[i][j] = 1;
      }
    }
  }
  for (int i = 1; i <= k; i++) {
    scanf("%d %d", &q[i].x, &q[i].y);
    a[q[i].x][q[i].y] = 1;
  }
  now = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] == 0) {
        dp[i][j] = min(min(dp[i - 1][j], dp[i][j - 1]), dp[i - 1][j - 1]) + 1;
        now = max(now, dp[i][j]);
      } else {
        dp[i][j] = 0;
      }
    }
  }
  ans[k] = now;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (a[i][j] == 0) up[i][j] = up[i - 1][j] + 1;
      if (a[n - i + 1][j] == 0) down[n - i + 1][j] = down[n - i + 2][j] + 1;
    }
  }
  for (int T = k - 1; T >= 1; T--) {
    int x = q[T + 1].x, y = q[T + 1].y;
    a[x][y] = 0;
    for (int i = 1; i <= n; i++) {
      if (a[i][y] == 0) up[i][y] = up[i - 1][y] + 1;
      if (a[n - i + 1][y] == 0) down[n - i + 1][y] = down[n - i + 2][y] + 1;
    }
    while (now < min(n, m) && get_ans(now + 1, x, y)) now++;
    ans[T] = now;
  }
  for (int i = 1; i <= k; i++) printf("%d\n", ans[i]);
  return 0;
}
