#include <bits/stdc++.h>
using namespace std;
struct aa {
  int top, now;
  bool f;
} a[300001];
int anss = 0;
int p;
char pp;
int n, m;
int main() {
  cin >> n >> m;
  int ans = 0;
  int ttop = 0;
  for (int i = 1; i <= n; i++) {
    cin >> pp;
    if (pp == '.') {
      a[i].f = 1;
      ans++;
      if (ttop == 0) {
        ttop = i;
      }
      a[i].top = ttop;
      a[i].now = ans;
    } else {
      if (ans == 0) {
      } else {
        anss = anss + ans - 1;
      }
      a[i].f = 0;
      ans = 0;
      ttop = 0;
    }
  }
  if (ans == 0) {
  } else {
    anss = anss + ans - 1;
  }
  for (int i = 1; i <= m; i++) {
    cin >> p >> pp;
    if (pp == '.') {
      if (a[p].f == 1) {
      } else {
        a[p].f = 1;
        if (a[p - 1].f == 1 && a[p + 1].f == 1) {
          anss += 2;
        } else if (a[p - 1].f == 1 || a[p + 1].f == 1) {
          anss += 1;
        }
      }
    } else {
      if (a[p].f == 0) {
      } else {
        a[p].f = 0;
        if (a[p - 1].f == 0 && a[p + 1].f == 0) {
        } else if (a[p - 1].f == 0 || a[p + 1].f == 0) {
          anss -= 1;
        } else {
          anss -= 2;
        }
      }
    }
    cout << anss << endl;
  }
}
