#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    string str;
    cin >> str;
    int sum = 0, l = str.size();
    for (int i = 0; i < l - 1; i++) {
      if (str[i] == '.' && str[i + 1] == '.') sum++;
    }
    int x;
    char c;
    for (int i = 0; i < m; i++) {
      cin >> x >> c;
      x--;
      if (c != '.') {
        if (x - 1 >= 0 && str[x] == '.' && str[x - 1] == '.') sum--;
        if (x + 1 < l && str[x] == '.' && str[x + 1] == '.') sum--;
        str[x] = c;
      } else if (str[x] != '.') {
        str[x] = c;
        if (x - 1 >= 0 && str[x] == '.' && str[x - 1] == '.') sum++;
        if (x + 1 < l && str[x] == '.' && str[x + 1] == '.') sum++;
      }
      printf("%d\n", sum);
    }
  }
  return 0;
}
