#include <bits/stdc++.h>
typedef enum boolean { No = 0, Yes = 1 } Bool;
typedef struct Query {
  long long int n;
  char nC;
} query;
long long int sL;
long long int qC;
long long int awq;
char mmmmm = '.';
int main(int argc, const char* argv[]) {
  scanf("%lld", &sL);
  scanf("%lld", &qC);
  char s[sL];
  long long int ccccc[qC];
  query q[qC];
  scanf("%s", s);
  Bool iC = No;
  int cccccccccccc = 0;
  for (long long int r = 0; r < sL; r++) {
    if (!iC && s[r] == mmmmm) {
      iC = Yes;
    } else if (iC && s[r] == mmmmm) {
      cccccccccccc++;
    }
    if (s[r] != mmmmm) {
      iC = No;
      awq += cccccccccccc;
      cccccccccccc = 0;
    } else if (r == sL - 1)
      awq += cccccccccccc;
  }
  for (int i = 0; i < qC; i++) {
    ccccc[i] = 0;
    scanf("%lld %c", &q[i].n, &q[i].nC);
  }
  for (long long int i = 0; i < qC; i++) {
    int maq = 0;
    if (s[(q[i].n - 1)] == mmmmm) {
      if ((q[i].n - 2) > -1 ? s[(q[i].n - 2)] == mmmmm : No) {
        maq++;
      }
      if ((q[i].n) < sL ? s[(q[i].n)] == mmmmm : No) {
        maq++;
      }
    }
    if (q[i].nC == mmmmm) {
      if ((q[i].n - 2) > -1 ? s[(q[i].n - 2)] == mmmmm : No) {
        maq--;
      }
      if ((q[i].n) < sL ? s[(q[i].n)] == mmmmm : No) {
        maq--;
      }
    }
    s[(q[i].n - 1)] = q[i].nC;
    awq -= maq;
    ccccc[i] = awq;
  }
  for (long long int i = 0; i < qC; i++) {
    printf("%lld\n", ccccc[i]);
  }
  return 0;
}
