#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int tot = 0;
  string a, b;
  cin >> b;
  a = "$" + b + "$";
  int cur = 0;
  for (int i = 0; i < a.length(); i++) {
    if (a[i] == '.')
      cur++;
    else {
      tot = tot + (max(0, cur - 1));
      cur = 0;
    }
  }
  int first;
  char c;
  while (m--) {
    cin >> first >> c;
    if (a[first] == c) {
      cout << tot << "\n";
      continue;
    }
    if (c == '.') {
      if (a[first - 1] == '.' && a[first + 1] == '.')
        tot += 2;
      else if (a[first - 1] == '.' || a[first + 1] == '.')
        tot += 1;
      a[first] = c;
    } else {
      if (a[first - 1] == '.' && a[first + 1] == '.' && a[first] == '.')
        tot -= 2;
      else if ((a[first - 1] == '.' || a[first + 1] == '.') && a[first] == '.')
        tot -= 1;
      a[first] = c;
    }
    cout << tot << "\n";
  }
}
