#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-12;
const int inf = 0x3f3f3f3f;
const int maxn = 2e6 + 20;
const int maxm = 2e3 + 20;
int in(int &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return -1;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
char s[maxm][maxm];
int a[maxm], b[maxm];
int dp[maxm][maxm];
int up[maxm][maxm];
int down[maxm][maxm];
int n, m, k;
int motherfucker() {
  int mx = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      if (s[i][j] == '.') {
        dp[i][j] = min(min(dp[i - 1][j], dp[i][j - 1]), dp[i - 1][j - 1]) + 1;
        mx = max(mx, dp[i][j]);
      }
    }
  for (int j = 1; j <= m; ++j) {
    for (int i = 1; i <= n; ++i) {
      if (s[i][j] == '.')
        up[i][j] = up[i - 1][j] + 1;
      else
        up[i][j] = 0;
    }
    for (int i = n; i; --i)
      if (s[i][j] == '.')
        down[i][j] = down[i + 1][j] + 1;
      else
        down[i][j] = 0;
  }
  return mx;
}
int sq;
void update(int x, int y) {
  s[x][y] = '.';
  for (int i = 1; i <= n; ++i)
    if (s[i][y] == '.')
      up[i][y] = up[i - 1][y] + 1;
    else
      up[i][y] = 0;
  for (int i = n; i; --i)
    if (s[i][y] == '.')
      down[i][y] = down[i + 1][y] + 1;
    else
      down[i][y] = 0;
}
int ans[maxm];
int q1[maxm];
int q2[maxm];
int l1, l2, r1, r2;
bool check(int d, int x, int y) {
  if (d > m || d > n) return 0;
  l1 = l2 = r1 = r2 = 0;
  for (int i = 1; i <= d; ++i) {
    while (r1 > l1 && up[x][i] <= up[x][q1[r1 - 1]]) --r1;
    q1[r1++] = i;
    while (r2 > l2 && down[x][i] <= down[x][q2[r2 - 1]]) --r2;
    q2[r2++] = i;
  }
  if (up[x][q1[l1]] + down[x][q2[l2]] - 1 >= d) return 1;
  for (int i = d + 1; i <= m; ++i) {
    while (r1 > l1 && up[x][i] <= up[x][q1[r1 - 1]]) --r1;
    q1[r1++] = i;
    while (r2 > l2 && down[x][i] <= down[x][q2[r2 - 1]]) --r2;
    q2[r2++] = i;
    while (i - q1[l1] >= d) ++l1;
    while (i - q2[l2] >= d) ++l2;
    if (up[x][q1[l1]] + down[x][q2[l2]] - 1 >= d) return 1;
  }
  return 0;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; ++i) scanf("%s", s[i] + 1);
  for (int i = 1; i <= k; ++i) {
    scanf("%d%d", &a[i], &b[i]);
    s[a[i]][b[i]] = '#';
  }
  sq = motherfucker();
  ans[k] = sq;
  for (int i = k; i; --i) {
    update(a[i], b[i]);
    while (check(sq + 1, a[i], b[i])) ++sq;
    ans[i - 1] = sq;
  }
  for (int i = 1; i <= k; ++i) printf("%d\n", ans[i]);
  return 0;
}
