#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, count = 0;
  char c;
  cin >> n >> m;
  cin.ignore();
  string s;
  getline(cin, s);
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '.' && s[i + 1] == '.') count++;
  }
  for (int i = 0; i < m; i++) {
    cin >> x >> c;
    if (isalpha(s[x - 1]) && c == '.') {
      if (x > 1) {
        if (s[x] == '.') count++;
        if (s[x - 2] == '.') count++;
      } else {
        if (s[x] == '.') count++;
      }
    } else if (s[x - 1] == '.' && isalpha(c)) {
      if (x > 1) {
        if (s[x] == '.') count--;
        if (s[x - 2] == '.') count--;
      } else {
        if (s[x] == '.') count--;
      }
    }
    s[x - 1] = c;
    cout << count << endl;
  }
  return 0;
}
