#include <bits/stdc++.h>
using namespace std;
int n, m, pos, amount, ans;
char c;
bool period[300005];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> c;
    if (c == '.') {
      period[i] = true;
      amount++;
    } else if (amount >= 2) {
      ans += amount - 1;
      amount = 0;
    } else
      amount = 0;
  }
  if (amount >= 2) ans += amount - 1;
  for (int i = 1; i <= m; i++) {
    cin >> pos >> c;
    if (c == '.' && period[pos] != true) {
      period[pos] = true;
      if (period[pos - 1]) ans++;
      if (period[pos + 1]) ans++;
    } else if (c != '.' && period[pos] != false) {
      period[pos] = false;
      if (period[pos - 1]) ans--;
      if (period[pos + 1]) ans--;
    }
    cout << ans << endl;
  }
  return 0;
}
