#include <bits/stdc++.h>
template <class T>
void read(T &x) {
  int f = 1;
  char c = getchar();
  x = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  x *= f;
}
template <class T>
void write(T x) {
  int len = 0;
  char s[30];
  if (x < 0) putchar('-'), x = -x;
  do {
    s[++len] = x % 10;
    x /= 10;
  } while (x);
  while (len) putchar(s[len--] + '0');
}
template <class T>
inline bool gmin(T &a, T b) {
  return a > b ? a = b, true : false;
}
template <class T>
inline bool gmax(T &a, T b) {
  return a < b ? a = b, true : false;
}
const int maxn = 2005;
const int INF = 0x3f3f3f3f;
struct Node {
  int x, y;
} p[maxn];
int minu[maxn << 2], mind[maxn << 2];
int G[maxn][maxn];
int U[maxn][maxn];
int D[maxn][maxn];
int left[maxn], right[maxn];
int ans[maxn];
int N, M, K;
int min1, min2;
void query(int L, int R, int o, int l, int r) {
  if (L <= l && r <= R) {
    min1 = std::min(min1, minu[o]);
    min2 = std::min(min2, mind[o]);
    return;
  }
  int m = ((l + r) >> 1);
  if (L <= m) query(L, R, (o << 1), l, m);
  if (m < R) query(L, R, (o << 1 | 1), m + 1, r);
}
void build(int x, int o, int l, int r) {
  if (l == r) {
    minu[o] = U[x][l];
    mind[o] = D[x][l];
    return;
  }
  int m = ((l + r) >> 1);
  build(x, (o << 1), l, m);
  build(x, (o << 1 | 1), m + 1, r);
  minu[o] = std::min(minu[(o << 1)], minu[(o << 1 | 1)]);
  mind[o] = std::min(mind[(o << 1)], mind[(o << 1 | 1)]);
}
int calc() {
  int ans = 0;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) {
      int x = j;
      while (x > 1 && U[i][x - 1] >= U[i][j]) x = left[x - 1];
      left[j] = x;
    }
    for (int j = M; j >= 1; j--) {
      int x = j;
      while (x < M && U[i][x + 1] >= U[i][j]) x = right[x + 1];
      right[j] = x;
    }
    for (int j = 1; j <= M; j++)
      gmax(ans, std::min(U[i][j], right[j] - left[j] + 1));
  }
  return ans;
}
int check(int size, int y) {
  if (size > N || size > M) return 0;
  for (int i = std::max(1, y - size + 1); i <= M - size + 1; i++) {
    min1 = min2 = INF;
    query(i, i + size - 1, 1, 1, M);
    if (min1 + min2 - 1 >= size) return 1;
  }
  return 0;
}
void solve() {
  memset(U, 0, sizeof(U));
  memset(D, 0, sizeof(D));
  memset(G, 0, sizeof(G));
  memset(ans, 0, sizeof(ans));
  for (int i = 1; i <= N; i++) {
    getchar();
    for (int j = 1; j <= M; j++) {
      char c = getchar();
      G[i][j] = c == '.';
    }
  }
  for (int i = 0; i < K; i++) {
    scanf("%d%d", &p[i].x, &p[i].y);
    G[p[i].x][p[i].y] = 0;
  }
  for (int i = 1; i <= N; i++)
    for (int j = 1; j <= M; j++) U[i][j] = G[i][j] ? U[i - 1][j] + 1 : 0;
  for (int i = N; i >= 1; i--)
    for (int j = 1; j <= M; j++) D[i][j] = G[i][j] ? D[i + 1][j] + 1 : 0;
  int size = calc();
  for (int i = K - 1; i >= 0; i--) {
    ans[i] = size;
    if (!i) break;
    int x = p[i].x, y = p[i].y;
    G[x][y] = 1;
    U[x][y] = U[x - 1][y] + 1;
    for (int j = x + 1; j <= N; j++) {
      if (!G[j][y]) break;
      U[j][y] += U[x][y];
    }
    D[x][y] = D[x + 1][y] + 1;
    for (int j = x - 1; j >= 1; j--) {
      if (!G[j][y]) break;
      D[j][y] += D[x][y];
    }
    build(x, 1, 1, M);
    while (check(size + 1, y)) ++size;
  }
  for (int i = 0; i < K; i++) printf("%d\n", ans[i]);
}
int main() {
  while (~scanf("%d%d%d", &N, &M, &K)) solve();
  return 0;
}
