#include <bits/stdc++.h>
using namespace std;
char mass[500000];
int main() {
  int n, m;
  cin >> n >> m;
  scanf("%s", mass);
  char c1, c2, tmp;
  int bal = 0;
  for (int i = 1; i < n; i++) {
    if (mass[i] == '.' && mass[i - 1] == '.') {
      bal++;
    }
  }
  for (int i = 0; i < m; i++) {
    int pos;
    scanf("%d%c%c", &pos, &c1, &c2);
    pos--;
    if (c2 == '.') {
      if (mass[pos] != '.') {
        if (pos && mass[pos - 1] == '.') {
          bal++;
        }
        if (pos < n - 1 && mass[pos + 1] == '.') {
          bal++;
        }
      }
    } else {
      if (mass[pos] == '.') {
        if (pos && mass[pos - 1] == '.') {
          bal--;
        }
        if (pos < n - 1 && mass[pos + 1] == '.') {
          bal--;
        }
      }
    }
    mass[pos] = c2;
    printf("%d\n", bal);
  }
  return 0;
}
