#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
const long double eps = 1e-7;
int main() {
  ios ::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  if (n == 1) {
    for (int i = 1; i <= m; i++) {
      int x;
      char c;
      cin >> x >> c;
      cout << 0 << endl;
    }
    return 0;
  }
  int st = 0;
  int cmp = 0;
  bool flg = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') st++;
    if (flg == 0 && s[i] == '.') {
      flg = 1;
      cmp++;
    }
    if (s[i] != '.') flg = 0;
  }
  for (int i = 1; i <= m; i++) {
    int x;
    char c;
    cin >> x >> c;
    x--;
    if ((s[x] != '.' && c != '.') || (s[x] == '.' && c == '.')) {
      cout << st - cmp << endl;
      continue;
    }
    if (s[x] == '.') {
      st--;
      if (x == n - 1) {
        if (s[x - 1] != '.') cmp--;
      } else if (x == 0) {
        if (s[x + 1] != '.') cmp--;
      } else {
        if (s[x - 1] == '.' && s[x + 1] == '.')
          cmp++;
        else if (s[x - 1] != '.' && s[x + 1] != '.')
          cmp--;
      }
      s[x] = c;
    } else {
      st++;
      if (x == n - 1) {
        if (s[x - 1] != '.') cmp++;
      } else if (x == 0) {
        if (s[x + 1] != '.') cmp++;
      } else {
        if (s[x - 1] != '.' && s[x + 1] != '.') cmp++;
        if (s[x - 1] == '.' && s[x + 1] == '.') cmp--;
      }
      s[x] = c;
    }
    cout << st - cmp << endl;
  }
  return 0;
}
