#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  long long int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  set<pair<long long int, long long int>> st;
  for (long long int i = 0; i < n - 1; i++) {
    if (s[i] == '.' && s[i + 1] == '.') st.insert({i, i + 1});
  }
  while (q--) {
    long long int pos;
    char c;
    cin >> pos >> c;
    pos--;
    if (s[pos] == '.' && c != '.') {
      if (pos > 0 && s[pos - 1] == '.') st.erase(st.find({pos - 1, pos}));
      if (pos < n - 1 && s[pos + 1] == '.') st.erase(st.find({pos, pos + 1}));
    }
    if (s[pos] != '.' && c == '.') {
      if (pos > 0 && s[pos - 1] == '.') st.insert({pos - 1, pos});
      if (pos < n - 1 && s[pos + 1] == '.') st.insert({pos, pos + 1});
    }
    s[pos] = c;
    cout << st.size() << endl;
  }
}
