#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int X = 0, w = 1;
  char ch = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    X = (X << 3) + (X << 1) + ch - '0', ch = getchar();
  return X * w;
}
char s[2018];
int n, m, k, ans, l[2018], r[2018], f[2018][2018];
bool a[2018][2018];
struct mmp {
  int x, y, ans;
} cz[2018];
vector<int> q[2018];
bool ck(int y, int x) {
  for (int i = max(x, y); i <= n; i++) {
    int z = i + 1 - y;
    if (min(r[i], r[z]) - max(l[i], l[z]) + 1 >= y) {
      return 1;
    }
  }
  return 0;
}
int main() {
  n = read(), m = read(), k = read();
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    for (int j = 1; j <= m; j++) {
      a[i][j] = (s[j] == '.');
    }
  }
  for (int i = 1; i <= k; i++) {
    int x = read(), y = read();
    a[x][y] = 0;
    cz[i].x = x;
    cz[i].y = y;
  }
  for (int i = 1; i <= n; i++) {
    q[i].push_back(0);
    for (int j = 1; j <= m; j++) {
      if (a[i][j] == 1) {
        f[i][j] = min(min(f[i][j - 1], f[i - 1][j]), f[i - 1][j - 1]) + 1;
      } else {
        q[i].push_back(j);
      }
      if (f[i][j] > ans) {
        ans = f[i][j];
      }
    }
    q[i].push_back(m + 1);
  }
  cz[k].ans = ans;
  for (int i = k - 1; i; i--) {
    int x = cz[i + 1].x, y = cz[i + 1].y;
    int z = lower_bound(q[x].begin(), q[x].end(), y) - q[x].begin();
    for (int j = z + 1; j < (int)q[x].size(); j++) {
      q[x][j - 1] = q[x][j];
    }
    q[x].pop_back();
    z = upper_bound(q[x].begin(), q[x].end(), y) - q[x].begin() - 1;
    l[x] = max(1, q[x][z] + 1);
    z = lower_bound(q[x].begin(), q[x].end(), y) - q[x].begin();
    r[x] = min(q[x][z] - 1, m);
    for (int j = x - 1; j; j--) {
      z = upper_bound(q[j].begin(), q[j].end(), y) - q[j].begin() - 1;
      l[j] = max(q[j][z] + 1, l[j + 1]);
      z = lower_bound(q[j].begin(), q[j].end(), y) - q[j].begin();
      r[j] = min(q[j][z] - 1, r[j + 1]);
    }
    for (int j = x + 1; j <= n; j++) {
      z = upper_bound(q[j].begin(), q[j].end(), y) - q[j].begin() - 1;
      l[j] = max(q[j][z] + 1, l[j - 1]);
      z = lower_bound(q[j].begin(), q[j].end(), y) - q[j].begin();
      r[j] = min(q[j][z] - 1, r[j - 1]);
    }
    int rl = 1, rr = min(n, m), atp = 1;
    while (rl <= rr) {
      int mid = (rl + rr) >> 1;
      if (ck(mid, x)) {
        atp = mid;
        rl = atp + 1;
      } else {
        rr = mid - 1;
      }
    }
    cz[i].ans = max(cz[i + 1].ans, atp);
  }
  for (int i = 1; i <= k; i++) {
    printf("%d\n", cz[i].ans);
  }
  return 0;
}
