#include <bits/stdc++.h>
using namespace std;
int n, m;
string str;
set<pair<int, int> > s;
void print() {
  for (set<pair<int, int> >::iterator itr = s.begin(); itr != s.end(); itr++)
    cout << (*itr).first << "," << (*itr).second << " ";
  cout << endl;
}
int main() {
  cin >> n >> m >> str;
  int a = -1, b = -1, res = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] != '.') {
      if (a != -1) {
        s.insert(make_pair(b + 1, a + 1));
        res += b - a;
        a = -1;
      }
    } else {
      if (a == -1) a = i;
      b = i;
    }
  }
  if (a != -1) {
    s.insert(make_pair(b + 1, a + 1));
    res += b - a;
  }
  s.insert(make_pair(0, 0));
  s.insert(make_pair(n + 1, n + 1));
  for (int i = 0; i < m; i++) {
    int idx;
    char ch;
    cin >> idx >> ch;
    set<pair<int, int> >::iterator itr = s.lower_bound(make_pair(idx, -1));
    pair<int, int> p = *itr;
    int end = p.first, start = p.second;
    if (ch != '.') {
      if (idx >= start) {
        res -= end - start;
        s.erase(itr);
        if (idx - 1 >= start) {
          s.insert(make_pair(idx - 1, start));
          res += idx - 1 - start;
        }
        if (end >= idx + 1) {
          s.insert(make_pair(end, idx + 1));
          res += end - idx - 1;
        }
      }
    } else {
      if (idx < start) {
        pair<int, int> np = make_pair(idx, idx);
        if (idx + 1 == start && idx + 1 <= n) {
          np.first = end;
          s.erase(itr);
          res -= end - start;
        }
        set<pair<int, int> >::iterator itr2 = s.lower_bound(make_pair(idx, -1));
        itr2--;
        pair<int, int> prev = *itr2;
        if (idx - 1 == prev.first && idx - 1 >= 1) {
          np.second = prev.second;
          s.erase(itr2);
          res -= prev.first - prev.second;
        }
        res += np.first - np.second;
        s.insert(np);
      }
    }
    cout << res << endl;
  }
  return 0;
}
