#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  int n, q;
  cin >> n >> q;
  cin >> s;
  int cntDots = 0, cntComps = 0;
  int pos = 0;
  while (pos < n) {
    if (s[pos] != '.') {
      ++pos;
      continue;
    } else {
      while (pos < n and s[pos] == '.') {
        ++pos;
        ++cntDots;
      }
      ++cntComps;
    }
  }
  while (q--) {
    int p;
    string r;
    cin >> p >> r;
    --p;
    if (r[0] == '.') {
      if (s[p] != '.') {
        ++cntDots;
        if ((p == 0 or s[p - 1] != '.') and (p == n - 1 or s[p + 1] != '.'))
          ++cntComps;
        else if (p > 0 and s[p - 1] == '.' and p + 1 < n and s[p + 1] == '.')
          --cntComps;
        s[p] = '.';
      }
    } else {
      if (s[p] == '.') {
        --cntDots;
        if ((p == 0 or s[p - 1] != '.') and (p == n - 1 or s[p + 1] != '.'))
          --cntComps;
        else if (p > 0 and s[p - 1] == '.' and p + 1 < n and s[p + 1] == '.')
          ++cntComps;
      }
      s[p] = r[0];
    }
    cout << (cntDots - cntComps) << "\n";
  }
  return 0;
}
