#include <bits/stdc++.h>
using namespace std;
int N, M, Answer;
char Arr[300005];
void Read() {
  scanf("%d %d", &N, &M);
  scanf("%s", Arr + 1);
  return;
}
void Write() {
  printf("%d\n", Answer);
  return;
}
void Process_1() {
  for (int i = 1; i <= N; i++)
    if (Arr[i] == '.' && Arr[i + 1] == '.') Answer++;
  return;
}
void Process_2() {
  for (int i = 1; i <= M; i++) {
    int x;
    char c;
    scanf("%d %c", &x, &c);
    if (Arr[x] == '.' && Arr[x + 1] == '.') Answer--;
    if (Arr[x] == '.' && Arr[x - 1] == '.') Answer--;
    Arr[x] = c;
    if (Arr[x] == '.' && Arr[x + 1] == '.') Answer++;
    if (Arr[x] == '.' && Arr[x - 1] == '.') Answer++;
    Write();
  }
  return;
}
int main() {
  Read();
  Process_1();
  Process_2();
  return 0;
}
