#include <bits/stdc++.h>
using namespace std;
long long solve() {
  long long n, q, t = 0, a, b;
  char c;
  string s;
  cin >> n >> q >> s;
  for (long long i = 1; i < s.size(); i++) {
    if (s[i] == '.' && s[i - 1] == '.') t++;
  }
  for (long long i = 0; i < q; i++) {
    cin >> a >> c;
    b = 0;
    if (a > 1 && s[a - 2] == '.') b++;
    if (a < n && s[a] == '.') b++;
    if (c == '.' && s[a - 1] != '.')
      t = t + b;
    else if (c != '.' && s[a - 1] == '.')
      t = t - b;
    cout << t << "\n";
    s[a - 1] = c;
  }
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
}
