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