#include <bits/stdc++.h>
using namespace std;
int ml[2008][2008], mr[2008][2008], delet[2008][2008], u[2008], v[2008],
    L[2008], R[2008];
int n, m, K, g1[2008][2008], g2[2008][2008], g[2008][2008], ans, ANS[2008];
char s[2008][2008];
int getfa1(int x, int y) {
  if (!delet[x][y]) return y;
  ml[x][y] = getfa1(x, ml[x][y]);
  return ml[x][y];
}
int find1(int x, int y) {
  if (s[x][y] != '.') return y;
  return getfa1(x, ml[x][y]) + 1;
}
int getfa2(int x, int y) {
  if (!delet[x][y]) return y;
  mr[x][y] = getfa2(x, mr[x][y]);
  return mr[x][y];
}
int find2(int x, int y) {
  if (s[x][y] != '.') return y;
  return getfa2(x, mr[x][y]) - 1;
}
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", &u[i], &v[i]);
    s[u[i]][v[i]] = 'R';
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (s[i][j] == '.')
        g1[i][j] = g1[i][j - 1] + 1;
      else
        g1[i][j] = 0;
  for (int j = 1; j <= m; j++)
    for (int i = 1; i <= n; i++)
      if (s[i][j] == '.')
        g2[i][j] = g2[i - 1][j] + 1;
      else
        g2[i][j] = 0;
  for (int i = 1; i <= n; i++) {
    int now = 0;
    for (int j = 1; j <= m; j++) {
      ml[i][j] = now;
      if (s[i][j] != '.') now = j;
    }
    now = m + 1;
    for (int j = m; j >= 1; j--) {
      mr[i][j] = now;
      if (s[i][j] != '.') now = j;
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      g[i][j] = min(g[i - 1][j - 1] + 1, min(g1[i][j], g2[i][j]));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) ans = max(ans, g[i][j]);
  ANS[K] = ans;
  ans++;
  for (int i = K; i >= 1; i--) {
    int x = u[i], y = v[i];
    delet[x][y] = 1;
    s[x][y] = '.';
    for (; ans <= n; ans++) {
      bool flag = 0;
      for (int j = 1; j <= n; j++) L[j] = find1(j, y), R[j] = find2(j, y);
      for (int j = x + 1; j <= n; j++)
        L[j] = max(L[j], L[j - 1]), R[j] = min(R[j], R[j - 1]);
      for (int j = x - 1; j >= 1; j--)
        L[j] = max(L[j], L[j + 1]), R[j] = min(R[j], R[j + 1]);
      for (int j = x; j <= n; j++) {
        int k = j - ans + 1;
        if (k <= 0) continue;
        int ll = max(L[j], L[k]), rr = min(R[j], R[k]);
        if (rr - ll + 1 >= ans) flag = 1;
      }
      if (!flag) break;
    }
    ANS[i - 1] = ans - 1;
  }
  for (int i = 1; i <= K; i++) printf("%d\n", ANS[i]);
}
