#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
char a[maxn];
vector<pair<int, int> > v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, ans = 0;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    if (a[i] == '.') {
      int j = i;
      while (a[i] == '.') i++;
      i--;
      ans += i - j;
    }
  }
  char c;
  while (m--) {
    cin >> n >> c;
    if (c == '.') {
      if (a[n] != '.') {
        if (a[n - 1] == '.') ans++;
        if (a[n + 1] == '.') ans++;
      }
    } else if (a[n] == '.') {
      if (a[n - 1] == '.') ans--;
      if (a[n + 1] == '.') ans--;
    }
    a[n] = c;
    cout << ans << "\n";
  }
}
