#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2000;
const int INF = 0x3f3f3f3f;
int N, M, K;
pair<int, int> A[Maxn + 5];
int m[Maxn + 5][Maxn + 5];
int ans[Maxn + 5];
int up[Maxn + 5][Maxn + 5], down[Maxn + 5][Maxn + 5];
struct SegmentTree {
  struct Segment {
    int mind, minu;
  };
  Segment t[Maxn * 4 + 5];
  void pushup(int rt) {
    t[rt].mind = min(t[rt << 1].mind, t[rt << 1 | 1].mind);
    t[rt].minu = min(t[rt << 1].minu, t[rt << 1 | 1].minu);
  }
  void build(int rt, int l, int r, int h) {
    if (l == r) {
      t[rt].mind = down[h][l], t[rt].minu = up[h][l];
      return;
    }
    int mid = (l + r) >> 1;
    build(rt << 1, l, mid, h), build(rt << 1 | 1, mid + 1, r, h);
    pushup(rt);
  }
  int query_down(int rt, int l, int r, int ql, int qr) {
    if (l > qr || r < ql) return INF;
    if (ql <= l && r <= qr) return t[rt].mind;
    int mid = (l + r) >> 1;
    return min(query_down(rt << 1, l, mid, ql, qr),
               query_down(rt << 1 | 1, mid + 1, r, ql, qr));
  }
  int query_up(int rt, int l, int r, int ql, int qr) {
    if (l > qr || r < ql) return INF;
    if (ql <= l && r <= qr) return t[rt].minu;
    int mid = (l + r) >> 1;
    return min(query_up(rt << 1, l, mid, ql, qr),
               query_up(rt << 1 | 1, mid + 1, r, ql, qr));
  }
};
SegmentTree tree;
int calc() {
  static int f[Maxn + 5][Maxn + 5];
  int ret = 0;
  for (int i = 1; i <= N; i++) f[i][1] = m[i][1];
  for (int i = 1; i <= M; i++) f[1][i] = m[1][i];
  for (int i = 2; i <= N; i++)
    for (int j = 2; j <= M; j++)
      if (m[i][j] == 0)
        f[i][j] = 0;
      else
        f[i][j] = min(f[i - 1][j], min(f[i][j - 1], f[i - 1][j - 1])) + 1;
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) ret = max(ret, f[i][j]);
  return ret;
}
bool check(int siz, int y) {
  if (siz > N || siz > M) return false;
  for (int i = max(1, y - siz + 1); i <= M - siz + 1; i++) {
    int m1 = tree.query_down(1, 1, M, i, i + siz - 1),
        m2 = tree.query_up(1, 1, M, i, i + siz - 1);
    if (m1 + m2 - 1 >= siz) return true;
  }
  return false;
}
int main() {
  char inp[Maxn + 5];
  scanf("%d %d %d", &N, &M, &K);
  for (int i = 1; i <= N; i++) {
    scanf("%s", inp + 1);
    for (int j = 1; j <= M; j++) m[i][j] = (inp[j] == '.');
  }
  for (int i = 1; i <= K; i++) {
    scanf("%d %d", &A[i].first, &A[i].second);
    m[A[i].first][A[i].second] = 0;
  }
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) up[i][j] = m[i][j] ? up[i - 1][j] + 1 : 0;
  for (int i = N; i >= 1; i--)
    for (int j = 1; j <= M; j++) down[i][j] = m[i][j] ? down[i + 1][j] + 1 : 0;
  int siz = calc();
  for (int i = K; i >= 1; i--) {
    ans[i] = siz;
    if (i == 1) break;
    int x = A[i].first, y = A[i].second;
    m[x][y] = 1, up[x][y] = up[x - 1][y] + 1;
    for (int j = x + 1; j <= N; j++) {
      if (m[j][y] == 0) break;
      up[j][y] += up[x][y];
    }
    down[x][y] = down[x + 1][y] + 1;
    for (int j = x - 1; j >= 1; j--) {
      if (m[j][y] == 0) break;
      down[j][y] += down[x][y];
    }
    tree.build(1, 1, M, x);
    while (check(siz + 1, y)) siz++;
  }
  for (int i = 1; i <= K; i++) printf("%d\n", ans[i]);
  return 0;
}
