#include <bits/stdc++.h>
using namespace std;
void Rd(int &res) {
  char c;
  res = 0;
  while (c = getchar(), !isdigit(c))
    ;
  do {
    res = (res << 3) + (res << 1) + (c ^ 48);
  } while (c = getchar(), isdigit(c));
}
char str[300005];
int main() {
  int n, m, i, j, k;
  while (scanf("%d %d", &n, &m) != EOF) {
    scanf("%s", str + 1);
    int cnt = 0, part = 0;
    for (i = 1; i <= n; i++) {
      if (str[i] == '.') {
        cnt++;
        if (str[i - 1] != '.') part++;
      }
    }
    char s[3];
    while (m--) {
      scanf("%d %s", &k, s);
      if (s[0] == '.') {
        if (str[k] != '.') {
          cnt++;
          if (str[k - 1] == '.' && str[k + 1] == '.') part--;
          if (str[k - 1] != '.' && str[k + 1] != '.') part++;
        }
      } else {
        if (str[k] == '.') {
          cnt--;
          if (str[k - 1] == '.' && str[k + 1] == '.') part++;
          if (str[k - 1] != '.' && str[k + 1] != '.') part--;
        }
      }
      str[k] = s[0];
      printf("%d\n", cnt - part);
    }
  }
  return 0;
}
