#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  char s[300005];
  char s1[2];
  while (cin >> n >> m) {
    scanf("%s", s + 1);
    int i;
    int x;
    int l = strlen(s + 1);
    int ans = 0;
    for (i = 1; i <= l; i++) {
      if (s[i] == '.' && s[i + 1] == '.') ans++;
    }
    while (m--) {
      cin >> x >> s1[0];
      if ((s1[0] == '.' && s[x] == '.') || (s1[0] != '.' && s[x] != '.')) {
        cout << ans << endl;
        continue;
      }
      s[x] = s1[0];
      if (s1[0] != '.' && s[x - 1] == '.') ans--;
      if (s1[0] != '.' && s[x + 1] == '.') ans--;
      if (s1[0] == '.' && s[x + 1] == '.') ans++;
      if (s1[0] == '.' && s[x - 1] == '.') ans++;
      cout << ans << endl;
    }
  }
  return 0;
}
