#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  string s;
  cin >> n >> m;
  cin >> s;
  set<pair<int, int> > interval;
  int res = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != '.') continue;
    int j;
    for (j = i; j < n && s[j] == '.'; j++)
      ;
    j--;
    interval.insert(make_pair(j, i));
    res += (j - i);
    i = j;
  }
  for (int i = 0; i < m; i++) {
    int pos;
    char car;
    cin >> pos;
    pos--;
    cin >> car;
    if (car == '.') {
      if (s[pos] == '.') {
        cout << res << endl;
        continue;
      }
      s[pos] = car;
      int lost = 0, deb = pos, fin = pos;
      if (0 < pos && s[pos - 1] == '.') {
        set<pair<int, int> >::iterator it =
            interval.lower_bound(make_pair(pos - 1, -1));
        lost += ((*it).first - (*it).second);
        deb = (*it).second;
        interval.erase(it);
      }
      if (pos + 1 < n && s[pos + 1] == '.') {
        set<pair<int, int> >::iterator it =
            interval.lower_bound(make_pair(pos + 1, -1));
        lost += ((*it).first - (*it).second);
        fin = (*it).first;
        interval.erase(it);
      }
      res += (fin - deb);
      interval.insert(make_pair(fin, deb));
      res -= (lost);
      cout << res << endl;
    } else {
      if (s[pos] != '.') {
        cout << res << endl;
        continue;
      }
      s[pos] = car;
      set<pair<int, int> >::iterator it =
          interval.lower_bound(make_pair(pos, -1));
      int deb = (*it).second, fin = (*it).first;
      interval.erase(make_pair(fin, deb));
      res -= (fin - deb);
      if (0 < pos && s[pos - 1] == '.') {
        res += (pos - 1 - deb);
        interval.insert(make_pair(pos - 1, deb));
      }
      if (pos + 1 < n && s[pos + 1] == '.') {
        res += (fin - (pos + 1));
        interval.insert(make_pair(fin, pos + 1));
      }
      cout << res << endl;
    }
  }
  return 0;
}
