#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  string second;
  int tot = 0;
  cin >> n >> m >> second;
  char lst = 'a';
  int cnt = 0, dt = 0;
  for (char c : second) {
    if (lst != '.' && c == '.') cnt++;
    if (c == '.') dt++;
    lst = c;
  }
  for (int i = 0; i < m; i++) {
    int x;
    string tmp;
    cin >> x >> tmp;
    char c = tmp[0];
    x--;
    if (c == '.' && second[x] != '.') {
      dt++;
      if (x > 0 && second[x - 1] == '.')
        if (x < n - 1 && second[x + 1] == '.') cnt--;
      if (x == 0 || second[x - 1] != '.')
        if (x == n - 1 || second[x + 1] != '.') cnt++;
    }
    if (c != '.' && second[x] == '.') {
      dt--;
      if (x > 0 && second[x - 1] == '.')
        if (x < n - 1 && second[x + 1] == '.') cnt++;
      if (x == 0 || second[x - 1] != '.')
        if (x == n - 1 || second[x + 1] != '.') cnt--;
    }
    second[x] = c;
    printf("%d\n", dt - cnt);
  }
}
