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