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