#include <bits/stdc++.h>
char a[300010], c;
int main() {
  int n, m, x, ans = 0, len = 0;
  scanf("%d%d", &n, &m);
  scanf("%s", a);
  for (int i = 0; i < n; i++) {
    if (a[i] == '.')
      len++;
    else {
      if (len != 0) {
        ans += len - 1;
        len = 0;
      }
    }
  }
  if (len > 0) ans += len - 1;
  while (m--) {
    scanf("%d %c", &x, &c);
    getchar();
    x--;
    int j = 1, l = 0, r = 0;
    if (a[x] == '.' && c != '.') {
      a[x] = c;
      if (x + j < n && a[x + j] == '.') {
        l++;
      }
      j = 1;
      if (x - j < n && a[x - j] == '.') {
        r++;
      }
      if (l == 0 && r != 0 || r == 0 && l != 0) {
        ans--;
      } else if (l != 0 && r != 0) {
        ans -= 2;
      }
    } else if (a[x] != '.' && c == '.') {
      a[x] = c;
      if (x + j < n && a[x + j] == '.') {
        l++;
      }
      j = 1;
      if (x - j < n && a[x - j] == '.') {
        r++;
      }
      if (l == 0 && r != 0 || r == 0 && l != 0) {
        ans++;
      } else if (l != 0 && r != 0) {
        ans += 2;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
