#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e6 + 5;
char s[maxn];
int main() {
  int len, m;
  scanf("%d%d", &len, &m);
  scanf("%s", s + 1);
  int sum = 0;
  for (int i = 2; i <= len; i++)
    if (s[i] == '.' && s[i - 1] == '.') sum++;
  while (m--) {
    getchar();
    int x;
    char c;
    scanf("%d %c", &x, &c);
    if (c == '.' && s[x] != '.') {
      if (s[x - 1] == '.') sum++;
      if (s[x + 1] == '.') sum++;
    } else if (c != '.' && s[x] == '.') {
      if (s[x - 1] == '.') sum--;
      if (s[x + 1] == '.') sum--;
    }
    s[x] = c;
    printf("%d\n", sum);
  }
}
