#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, m;
  cin >> n;
  cin >> m;
  string s;
  cin >> s;
  cin.ignore();
  long int conteo = 0;
  for (long int i = 0; i < n; i++) {
    long int j = 0;
    if (s[i] == '.') {
      long int j = i;
      for (; j < n && s[j] == '.'; j++) {
      }
      long int aumen = j - i - 1;
      if (aumen < 0) {
        aumen = 0;
      }
      conteo += aumen;
      i = j;
    }
  }
  for (int i = 0; i < m; i++) {
    long int x;
    char c;
    cin >> x;
    cin >> c;
    if (c == '.' && s[x - 1] != '.') {
      if (x - 1 > 0) {
        if (s[x - 2] == '.') conteo++;
      }
      if (x - 1 < n - 1) {
        if (s[x] == '.') conteo++;
      }
    }
    if (c != '.' && s[x - 1] == '.') {
      if (x - 1 > 0) {
        if (s[x - 2] == '.') conteo--;
      }
      if (x - 1 < n - 1) {
        if (s[x] == '.') conteo--;
      }
    }
    s[x - 1] = c;
    cout << conteo << endl;
  }
  return 0;
}
