#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, m, res = 0, cnt = 0;
  string s;
  cin >> n >> m >> s;
  for (auto i : s) {
    if (i == '.')
      cnt++;
    else
      res += max(0, cnt - 1), cnt = 0;
  }
  res += max(0, cnt - 1);
  s = 'X' + s + 'X';
  int p;
  char c;
  while (m--) {
    cin >> p >> c;
    if ((s[p] == '.' and c == '.') or (s[p] != '.' and c != '.')) {
      cout << res << '\n';
      continue;
    }
    if (s[p - 1] == '.' and s[p + 1] == '.')
      res += (c == '.') ? 2 : -2;
    else if (s[p - 1] == '.' or s[p + 1] == '.')
      res += (c == '.') ? 1 : -1;
    s[p] = c;
    cout << res << '\n';
  }
  return 0;
}
