#include <bits/stdc++.h>
using namespace std;
struct query {
  int x, y, id, ans;
} q[2010];
bool cmp(query a, query b) { return a.id > b.id; }
bool cmp2(query a, query b) { return a.id < b.id; }
int a[2010][2010];
int l[2010][2010], r[2010][2010];
int dp[2010][2010];
int t[2010][2010];
int ql[2010], qr[2010];
int b[2010];
int n, m, k;
bool check(int x, int y, int ans) {
  int head = 1, tail = 0;
  for (int i = 1; i <= n; i++) {
    while (head <= tail && l[ql[tail]][y] >= l[i][y]) tail--;
    ql[++tail] = i;
    while (ql[head] <= i - ans) head++;
    b[i] = l[ql[head]][y];
  }
  head = 1;
  tail = 0;
  for (int i = 1; i <= n; i++) {
    while (head <= tail && r[ql[tail]][y] >= r[i][y]) tail--;
    ql[++tail] = i;
    while (ql[head] <= i - ans) head++;
    b[i] += r[ql[head]][y] - 1;
  }
  for (int i = 1; i <= n; i++)
    if (i >= ans && b[i] >= ans) return 1;
  return 0;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      char c;
      cin >> c;
      if (c == '.') a[i][j] = 1;
    }
  for (int i = 1; i <= k; i++) {
    scanf("%d%d", &q[i].x, &q[i].y);
    a[q[i].x][q[i].y] = 0;
    if (t[q[i].x][q[i].y] == 1) q[i].x = q[i].y = 0;
    t[q[i].x][q[i].y] = 1;
    q[i].id = i;
  }
  sort(q + 1, q + k + 1, cmp);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] == 0)
        l[i][j] = 0;
      else
        l[i][j] = l[i][j - 1] + 1;
  for (int i = 1; i <= n; i++)
    for (int j = m; j >= 1; j--)
      if (a[i][j] == 0)
        r[i][j] = 0;
      else
        r[i][j] = r[i][j + 1] + 1;
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (a[i][j] == 0)
        dp[i][j] = 0;
      else
        dp[i][j] = min(dp[i - 1][j], min(dp[i][j - 1], dp[i - 1][j - 1])) + 1;
      ans = max(ans, dp[i][j]);
    }
  for (int i = 1; i <= k; i++) {
    q[i].ans = ans;
    int x = q[i].x, y = q[i].y;
    for (int j = 1; j <= m; j++) {
      if (j < y) {
        if (j + r[x][j] == y) r[x][j] = r[x][y + 1] + y + 1 - j;
      }
      if (j == y) {
        r[x][y] = r[x][y + 1] + 1;
        l[x][y] = l[x][y - 1] + 1;
      }
      if (j > y) {
        if (j - l[x][j] == y) l[x][j] = l[x][y - 1] + j - y + 1;
      }
    }
    while (check(x, y, ans + 1)) ans++;
  }
  sort(q + 1, q + k + 1, cmp2);
  for (int i = 1; i <= k; i++) printf("%d\n", q[i].ans);
  return 0;
}
