#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch) && ch != '-') ch = getchar();
  if (ch == '-') f = -1, ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + ch - '0', ch = getchar();
  return x * f;
}
void write(int x) {
  char ch[20];
  int f = 0;
  if (!x) {
    putchar('0'), putchar('\n');
    return;
  }
  if (x < 0) putchar('-'), x = -x;
  while (x) ch[++f] = x % 10 + '0', x /= 10;
  while (f) putchar(ch[f--]);
  putchar('\n');
}
int qx[2007], qy[2007], q[2007], hd, tl;
int col[2007][2007], ans, lmx[2007][2007], rmx[2007][2007], n, m, k, res[2007],
    tmp[2007], dp[2007][2007];
char s[2007];
int jud(int yy) {
  hd = 1, tl = 0;
  for (int i = (1); i <= (n); ++i) {
    while (hd <= tl && q[hd] < i - (ans + 1) + 1) hd++;
    while (hd <= tl && lmx[q[tl]][yy] <= lmx[i][yy]) tl--;
    q[++tl] = i;
    if (i < ans + 1) continue;
    tmp[i] = yy - lmx[q[hd]][yy] + 1;
  }
  hd = 1, tl = 0;
  for (int i = (1); i <= (n); ++i) {
    while (hd <= tl && q[hd] < i - (ans + 1) + 1) hd++;
    while (hd <= tl && rmx[q[tl]][yy] >= rmx[i][yy]) tl--;
    q[++tl] = i;
    if (i < ans + 1) continue;
    tmp[i] += rmx[q[hd]][yy] - yy;
  }
  for (int i = (ans + 1); i <= (n); ++i)
    if (tmp[i] >= ans + 1) 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)
      if (s[j] != '.') col[i][j] = 1;
  }
  for (int i = (1); i <= (k); ++i)
    qx[i] = read(), qy[i] = read(), col[qx[i]][qy[i]] = 1;
  for (int i = (1); i <= (n); ++i) {
    for (int j = (1); j <= (m); ++j) {
      if (col[i][j]) {
        lmx[i][j] = j + 1;
        continue;
      }
      dp[i][j] = min(min(dp[i - 1][j], dp[i][j - 1]), dp[i - 1][j - 1]) + 1;
      ans = max(dp[i][j], ans);
      if (j == 1 || col[i][j - 1])
        lmx[i][j] = j;
      else
        lmx[i][j] = lmx[i][j - 1];
    }
    for (int j = (m); j >= (1); --j) {
      if (col[i][j]) {
        rmx[i][j] = j - 1;
        continue;
      }
      if (j == m || col[i][j + 1])
        rmx[i][j] = j;
      else
        rmx[i][j] = rmx[i][j + 1];
    }
  }
  for (int i = (k); i >= (1); --i) {
    res[i] = ans;
    col[qx[i]][qy[i]] = 0;
    int nl = qy[i], nr = qy[i];
    while (nl - 1 >= 1 && !col[qx[i]][nl - 1]) nl--;
    while (nr + 1 <= m && !col[qx[i]][nr + 1]) nr++;
    for (int j = (nl); j <= (nr); ++j) lmx[qx[i]][j] = nl, rmx[qx[i]][j] = nr;
    while (jud(qy[i])) ans++;
  }
  for (int i = (1); i <= (k); ++i) write(res[i]);
  return (0 - 0);
}
