#include <bits/stdc++.h>
using namespace std;
const int INF = (-1u) / 2;
const long long int INF2 = (-1ull) / 2;
int a, b, i, d[1011000], j, k, n, m, timer = 0, l, r, x, y;
int c[1011000], cnt = 0, fl = 0, a2, a3 = -1000000, ans = 0;
set<pair<int, int> > st;
set<pair<int, int> >::iterator it, it2;
string s;
char rt;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  cin >> s;
  for (i = 0; i < n; i++) {
    if (s[i] != '.') continue;
    k = i + 1;
    while (i < n && s[i] == '.') {
      i++;
    }
    st.insert({k, i});
    ans += (i - k);
    i--;
  }
  for (i = 0; i < m; i++) {
    cin >> x;
    cin >> rt;
    if (rt != '.') {
      st.insert({x + 1, -1});
      it = st.find({x + 1, -1});
      it2 = it;
      it++;
      st.erase(it2);
      s[x - 1] = rt;
      if (it == st.begin()) goto qw;
      it--;
      l = (*it).first;
      r = (*it).second;
      if (!(l <= x && x <= r)) goto qw;
      st.erase(it);
      if (x > l) {
        ans += ((x - 1) - l);
        st.insert({l, x - 1});
      }
      if (x < r) {
        ans += (r - (x + 1));
        st.insert({x + 1, r});
      }
      ans -= (r - l);
      goto qw;
    } else {
      if (s[x - 1] == rt) goto qw;
      s[x - 1] = rt;
      st.insert({x, -1});
      it = st.find({x, -1});
      it2 = it;
      it++;
      st.erase(it2);
      l = 0;
      r = 0;
      a = 0;
      b = 0;
      if (it != st.begin()) {
        it--;
        l = (*it).first;
        r = (*it).second;
        it++;
      }
      if (it != st.end()) {
        a = (*it).first;
        b = (*it).second;
      }
      if (l > 0 && a > 0 && r + 2 == a && r + 1 == x) {
        it2 = it;
        it2--;
        st.erase(it);
        st.erase(it2);
        ans -= (r - l);
        ans -= (b - a);
        ans += (b - l);
        st.insert({l, b});
      } else if (l > 0 && r + 1 == x) {
        it--;
        st.erase(it);
        st.insert({l, r + 1});
        ans++;
      } else if (a > 0 && a - 1 == x) {
        st.erase(it);
        st.insert({x, b});
        ans++;
      } else {
        st.insert({x, x});
      }
    }
  qw:;
    cout << ans << endl;
  }
  return 0;
}
