#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MAXN = 2005;
const int SZ = 1 << 11;
int N, M, K, A[2 * SZ][2][MAXN], V[2 * SZ], u[MAXN][MAXN], d[MAXN][MAXN];
int X, Y;
string S[MAXN];
int check(int *a1, int *a2) {
  int r = 0, res = 0;
  queue<int> q1, q2;
  deque<int> r1, r2;
  for (int i = 1; i <= M; i++) {
    while (r < i || r1.front() + r2.front() > r - i + 1 && r < M) {
      r++;
      res = max(res, r - i);
      q1.push(a1[r]);
      q2.push(a2[r]);
      while (r1.size() && r1.back() > a1[r]) r1.pop_back();
      while (r2.size() && r2.back() > a2[r]) r2.pop_back();
      r1.push_back(a1[r]);
      r2.push_back(a2[r]);
    }
    res = max(res, min(r1.front() + r2.front(), r - i + 1));
    if (r1.front() == q1.front()) r1.pop_front();
    if (r2.front() == q2.front()) r2.pop_front();
    q1.pop();
    q2.pop();
  }
  return res;
}
void build(int p, int l, int r) {
  int m = (l + r) / 2;
  if (l < r) {
    build(2 * p, l, m);
    build(2 * p + 1, m + 1, r);
  }
  if (m <= N) {
    for (int i = 1; i <= M; i++) {
      A[p][0][i] = min(m - l + 1, u[m][i]);
      A[p][1][i] = min(min(r, N) - m, d[m + 1][i]);
    }
  }
  V[p] = max(V[2 * p], V[2 * p + 1]);
  V[p] = max(V[p], check(A[p][0], A[p][1]));
}
void update(int x, int y, int p, int l, int r) {
  if (l == r) {
    A[p][0][y] = 0;
    V[p] = *max_element(A[p][0], A[p][0] + M + 1);
    return;
  }
  int m = (l + r) / 2;
  if (x <= m) {
    update(x, y, 2 * p, l, m);
    A[p][0][y] = min(A[p][0][y], m - x);
  } else {
    update(x, y, 2 * p + 1, m + 1, r);
    A[p][1][y] = min(A[p][1][y], x - m - 1);
  }
  V[p] = max(V[2 * p], V[2 * p + 1]);
  V[p] = max(V[p], check(A[p][0], A[p][1]));
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> M >> K;
  for (int i = 1; i <= N; i++) {
    cin >> S[i];
    for (int j = 1; j <= M; j++) {
      if (S[i][j - 1] == '.') u[i][j] = u[i - 1][j] + 1;
    }
  }
  for (int i = N; i >= 1; i--) {
    for (int j = 1; j <= M; j++) {
      if (S[i][j - 1] == '.') d[i][j] = d[i + 1][j] + 1;
    }
  }
  build(1, 1, SZ);
  while (K--) {
    cin >> X >> Y;
    update(X, Y, 1, 1, SZ);
    cout << V[1] << '\n';
  }
}
