#include <bits/stdc++.h>
using namespace std;
const int M = 300010;
bool taken[M];
char s[M];
int main(int argc, char** argv) {
  int len, m;
  scanf("%d%d\n", &len, &m);
  scanf("%s\n", s + 1);
  s[0] = 'x';
  s[len + 1] = 'x';
  len += 2;
  int out = 0;
  memset(taken, 0, sizeof taken);
  for (int i = 1; i < len; i++) {
    if (s[i] == '.' && s[i - 1] == '.') {
      out++;
      taken[i] = 1;
    }
  }
  int pos;
  char c;
  while (m--) {
    cin >> pos >> c;
    if (c == '.' && s[pos] != '.') {
      s[pos] = c;
      if (s[pos - 1] == '.') {
        out++;
        taken[pos] = 1;
      }
      if (s[pos + 1] == '.' && !taken[pos + 1]) {
        out++;
        taken[pos + 1] = 1;
      }
    }
    if (c != '.' && s[pos] == '.') {
      s[pos] = c;
      if (taken[pos]) {
        taken[pos] = 0;
        out--;
      }
      if (taken[pos + 1]) {
        taken[pos + 1] = 0;
        out--;
      }
    }
    cout << out << endl;
  }
  return 0;
}
