#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1.01e9;
const double eps = 1e-9;
const int maxn = (int)3e5 + 10;
char s[maxn];
set<int> S;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  scanf("%s", s);
  S.insert(-1);
  S.insert(n);
  int res = 0;
  int cur = 0;
  for (int i = 0; (i) < (n); ++i) {
    if (s[i] == '.')
      cur += 1;
    else
      cur = 0;
    if (cur > 1) res += 1;
  }
  for (int i = 0; (i) < (m); ++i) {
    int x;
    char c[2];
    scanf("%d%s", &x, c);
    --x;
    char prev = 0, next = 0;
    if (x > 0) prev = s[x - 1];
    if (x < n - 1) next = s[x + 1];
    if ((s[x] == '.') && (c[0] != '.')) {
      s[x] = c[0];
      if (prev == '.') res -= 1;
      if (next == '.') res -= 1;
    } else if ((s[x] != '.') && (c[0] == '.')) {
      s[x] = c[0];
      if (prev == '.') res += 1;
      if (next == '.') res += 1;
    }
    printf("%d\n", res);
  }
  return 0;
}
