#include <bits/stdc++.h>
using namespace std;
char s[400005];
int n, m;
int main() {
  scanf("%d%d%s", &n, &m, &s);
  int res = 0, cnt = 0;
  set<pair<int, int> > q;
  for (int i = 0; i <= n; ++i)
    if (s[i] == '.')
      ++cnt;
    else {
      res += max(0, cnt - 1);
      if (cnt) q.insert(make_pair(i - 1, cnt));
      cnt = 0;
    }
  int x;
  char c;
  while (m--) {
    scanf("%d %c", &x, &c);
    --x;
    if (s[x] == '.' && c == '.') {
      printf("%d\n", res);
      continue;
    }
    if (s[x] != '.' && c != '.') {
      printf("%d\n", res);
      continue;
    }
    if (s[x] == '.') {
      set<pair<int, int> >::iterator it = q.lower_bound(make_pair(x, -1));
      int len = it->second;
      int at = it->first;
      q.erase(it);
      res -= max(len - 1, 0);
      if (at - x) {
        q.insert(make_pair(x + at - x, at - x));
        res += max(0, at - x - 1);
      }
      if (len > at - x + 1) {
        q.insert(make_pair(x - 1, len - (at - x + 1)));
        res += max(0, len - (at - x + 1) - 1);
      }
      s[x] = c;
    } else {
      char p = x ? s[x - 1] : 'u';
      char z = x == n - 1 ? 'u' : s[x + 1];
      set<pair<int, int> >::iterator it;
      int len = 0;
      int at = x;
      if (p == '.') {
        it = q.lower_bound(make_pair(x - 1, -1));
        len += it->second;
        q.erase(it);
        res -= max(len - 1, 0);
      }
      ++len;
      if (z == '.') {
        it = q.lower_bound(make_pair(x, -1));
        res -= max(0, it->second - 1);
        len += it->second;
        at = it->first;
        q.erase(it);
      }
      q.insert(make_pair(at, len));
      res += max(len - 1, 0);
      s[x] = c;
    }
    printf("%d\n", res);
  }
  return 0;
}
