#include <bits/stdc++.h>
using namespace std;
typedef const int &ci;
inline int read() {
  int x = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while ('0' <= c && c <= '9') x = 10 * x + c - '0', c = getchar();
  return x;
}
inline void Max(int &x, ci y) {
  if (x < y) x = y;
}
const int N = 2003;
int n, m, k, Ans, ans[N];
int px[N], py[N];
char c[N][N];
int f[N][N];
int u[N][N], d[N][N];
int h1, t1, q1[N];
int h2, t2, q2[N];
inline void Calc(int *a, int *b) {
  q1[h1 = t1 = 1] = 1, q2[h2 = t2 = 1] = 1;
  for (int l = 1, r = 1; r <= m; l++) {
    while (h1 <= t1 && q1[h1] < l) h1++;
    while (h2 <= t2 && q2[h2] < l) h2++;
    while (r < l || r - l + 1 <= a[q1[h1]] + b[q2[h2]] - 1) {
      Max(Ans, r - l + 1), r++;
      while (h1 <= t1 && a[q1[t1]] >= a[r]) t1--;
      q1[++t1] = r;
      while (h2 <= t2 && b[q2[t2]] >= b[r]) t2--;
      q2[++t2] = r;
    }
    Max(Ans, a[q1[h1]] + b[q2[h2]] - 1);
  }
}
int main() {
  n = read(), m = read(), k = read();
  for (int i = 1; i <= n; i++) scanf("%s", c[i] + 1);
  for (int i = 1; i <= k; i++) {
    px[i] = read(), py[i] = read();
    c[px[i]][py[i]] = '#';
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (c[i][j] == '.') {
        f[i][j] = min(f[i - 1][j - 1], min(f[i - 1][j], f[i][j - 1])) + 1;
        Max(Ans, f[i][j]);
        u[i][j] = u[i - 1][j] + 1;
      }
  for (int i = n; i >= 1; i--)
    for (int j = m; j >= 1; j--)
      if (c[i][j] == '.') d[i][j] = d[i + 1][j] + 1;
  for (int Cas = k, x, y; Cas >= 1; Cas--) {
    ans[Cas] = Ans, c[x = px[Cas]][y = py[Cas]] = '.';
    for (int i = x; i <= n; i++)
      if (c[i][y] == '.') u[i][y] = u[i - 1][y] + 1;
    for (int i = x; i >= 1; i--)
      if (c[i][y] == '.') d[i][y] = d[i + 1][y] + 1;
    Calc(u[x], d[x]);
  }
  for (int i = 1; i <= k; i++) printf("%d\n", ans[i]);
  return 0;
}
