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