#include <bits/stdc++.h>
using namespace std;
const int M = 300010;
bool taken[M];
int main(int argc, char** argv) {
  ios::sync_with_stdio(0);
  string s;
  int len, m;
  cin >> len >> m;
  cin >> s;
  s = "x" + s + "x";
  int out = 0;
  memset(taken, 0, sizeof taken);
  for (int i = 1; i < s.length(); 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;
}
