#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  vector<long long> v;
  map<long long, long long> mp;
  for (int i = 0; i < s.length(); i++) {
    if (i + 1 < n && s[i] == '.' && s[i + 1] == '.') {
      mp[i + 1] = 1;
    }
  }
  for (int i = 0; i < m; i++) {
    int x;
    char c;
    long long temp = 0;
    cin >> x >> c;
    if (c != '.') {
      map<long long, long long>::iterator it, pt;
      it = mp.find(x);
      s[x - 1] = c;
      if (it != mp.end()) {
        mp.erase(it);
      }
      pt = mp.find(x - 1);
      if (pt != mp.end()) {
        mp.erase(pt);
      }
    } else {
      s[x - 1] = '.';
      if (x - 1 > 0 && s[x - 1 - 1] == '.') {
        mp[x - 1] = 1;
      }
      if (x + 1 <= n && s[x] == '.') {
        mp[x] = 1;
      }
    }
    long long p = mp.size();
    cout << p << endl;
  }
}
