#include <bits/stdc++.h>
using namespace std;
char s[300005];
int main() {
  int n, q, pos;
  scanf("%d%d\n", &n, &q);
  scanf("%s", s + 1);
  int cnt = 0;
  int ans = 0;
  char ch;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '.')
      cnt++;
    else if (cnt > 0) {
      ans += cnt - 1;
      cnt = 0;
    }
  }
  if (cnt > 0) ans += cnt - 1;
  for (int i = 1; i <= q; i++) {
    int res = 0;
    getchar();
    scanf("%d%*c%c", &pos, &ch);
    if (ch == '.' && s[pos] != ch) {
      int a = 0;
      if (pos - 1 > 0 && s[pos - 1] == '.') a++;
      if (pos + 1 <= n && s[pos + 1] == '.') a++;
      if (a == 1)
        res++;
      else if (a == 2)
        res += 2;
    } else if (s[pos] == '.' && ch != '.') {
      int a = 0;
      if (pos - 1 > 0 && s[pos - 1] == '.') a++;
      if (pos + 1 <= n && s[pos + 1] == '.') a++;
      if (a == 1)
        res--;
      else if (a == 2)
        res -= 2;
    }
    s[pos] = ch;
    cout << ans + res << "\n";
    ans += res;
  }
  return 0;
}
