#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  int n, m, seg = 0, len = 0, ans, i, in;
  char c;
  scanf("%d %d", &n, &m);
  cin >> s;
  s = "a" + s;
  s += "a";
  for (i = 0; i < s.length(); i++) {
    if (s[i] == '.') {
      seg++;
      for (; s[i] == '.' && i < s.length(); i++) len++;
    }
  }
  ans = len - seg;
  for (i = 0; i < m; i++) {
    cin >> in >> c;
    if ((s[in] == '.' && c != '.') || (s[in] != '.' && c == '.')) {
      if (c == '.') {
        if (s[in - 1] == '.') ans++;
        if (s[in + 1] == '.') ans++;
      } else {
        if (s[in - 1] == '.') ans -= (ans != 0);
        if (s[in + 1] == '.') ans -= (ans != 0);
      }
      s[in] = c;
    }
    printf("%d\n", ans);
  }
  return 0;
}
