#include <bits/stdc++.h>
using namespace std;
long long bgm(long long a, long long b, long long m) {
  a %= m;
  long long rem = 1;
  while (b) {
    if (b & 1) rem = (rem * a) % m;
    a = (a * a) % m;
    b >>= 1;
  }
  return rem;
}
long long in() {
  long long a;
  if (scanf("%lld", &a) == EOF) return EOF;
  return a;
}
long long dl() {
  double a;
  if (scanf("%lf", &a) == EOF) return EOF;
  return a;
}
const int MAX = 300005;
char str[MAX];
int n, m;
int cnt() {
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    while (i < n && str[i] == '.') cnt++, i++;
    if (cnt) ans += cnt - 1;
  }
  return ans;
}
int main() {
  n = in(), m = in();
  scanf(" %s", str);
  int now = cnt();
  while (m--) {
    int a = in() - 1;
    char c;
    scanf(" %c", &c);
    int ok = 0;
    if (a) ok = str[a - 1] == '.';
    if (a < n - 1) ok += str[a + 1] == '.';
    if (str[a] == c || (c != '.' && str[a] != '.')) ok = 0;
    if (c == '.' && str[a] != '.')
      now += ok;
    else if (c != '.' && str[a] == '.')
      now -= ok;
    str[a] = c;
    printf("%lld", (long long)(now)), puts("");
  }
  return 0;
}
