#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  string s;
  long long cnt = 0;
  cin >> s;
  vector<int> ans(m);
  for (int i = 0; i < s.size(); i++) {
    int temp = 0, j = i;
    for (; j < s.size() && s[j] == '.'; j++) ++temp;
    if (j != i) --j;
    if (temp) cnt += temp - 1;
    i = j;
  }
  for (int i = 0; i < m; i++) {
    int x;
    char y;
    cin >> x >> y;
    --x;
    if (y == '.') {
      if (s[x] == '.') goto uuu;
      if ((x - 1 >= 0 && s[x - 1] == '.')) ++cnt;
      if ((x + 1 < n && s[x + 1] == '.')) ++cnt;
      s[x] = y;
    } else {
      if (s[x] != '.') goto uuu;
      if ((x - 1 >= 0 && s[x - 1] == '.')) --cnt;
      if ((x + 1 < n && s[x + 1] == '.')) --cnt;
      s[x] = y;
    }
  uuu:
    ans[i] = cnt;
  }
  for (int i = 0; i < m; i++) printf("%d\n", ans[i]);
}
