#include <bits/stdc++.h>
using namespace std;
int n, m, ans = 0;
bool s[300005];
int main() {
  scanf("%d%d", &n, &m);
  string str;
  cin >> str;
  str = 'h' + str;
  for (int i = 0; i < n; i++) {
    if (str[i] == '.' && str[i + 1] == '.') s[i] = true;
    if (s[i]) ans++;
  }
  while (m--) {
    int x;
    char ch[5];
    scanf("%d%s", &x, ch);
    if (ch[0] != '.') {
      if (s[x - 1]) ans--;
      if (s[x]) ans--;
      s[x - 1] = false;
      s[x] = false;
    } else {
      if (str[x + 1] == '.' && s[x] == false) {
        s[x] = true;
        ans++;
      }
      if (str[x - 1] == '.' && s[x - 1] == false) {
        s[x - 1] = true;
        ans++;
      }
    }
    str[x] = ch[0];
    printf("%d\n", ans);
  }
  return 0;
}
