#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, j;
  int res = 0;
  int cnt = 0;
  int id;
  char ch;
  cin >> n >> m;
  string s;
  cin >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '.')
      cnt++;
    else {
      if (cnt != 0) res += (cnt - 1);
      cnt = 0;
    }
  }
  if (cnt != 0) res += (cnt - 1);
  while (m--) {
    cin >> id >> ch;
    if (n == 1)
      cout << 0 << endl;
    else {
      id--;
      if (ch == '.') {
        if (s[id] == '.')
          cout << res << endl;
        else {
          if (id == 0) {
            if (s[id + 1] == '.')
              cout << ++res << endl;
            else
              cout << res << endl;
          } else if (id == n - 1) {
            if (s[id - 1] == '.')
              cout << ++res << endl;
            else
              cout << res << endl;
          } else {
            if (s[id - 1] != '.' && s[id + 1] != '.')
              cout << res << endl;
            else if (s[id - 1] == '.' && s[id + 1] == '.') {
              res += 2;
              cout << res << endl;
            } else
              cout << ++res << endl;
          }
        }
        s[id] = ch;
      } else {
        if (s[id] != '.')
          cout << res << endl;
        else {
          if (id == 0) {
            if (s[id + 1] == '.')
              cout << --res << endl;
            else
              cout << res << endl;
          } else if (id == n - 1) {
            if (s[id - 1] == '.')
              cout << --res << endl;
            else
              cout << res << endl;
          } else {
            if (s[id - 1] != '.' && s[id + 1] != '.')
              cout << res << endl;
            else if (s[id - 1] == '.' && s[id + 1] == '.') {
              res -= 2;
              cout << res << endl;
            } else
              cout << --res << endl;
          }
        }
        s[id] = ch;
      }
    }
  }
  return 0;
}
