#include <bits/stdc++.h>
using namespace std;
const int mx = 300009;
map<int, int> mp;
char str[mx];
char a[9];
int main() {
  std::map<int, int>::iterator d, c;
  int n, m, ans = 0, l, i, j;
  scanf("%d%d", &n, &m);
  scanf("%s", str + 1);
  int next = 0;
  for (i = 1; i <= n; i++)
    if (str[i] != '.') {
      if (next != i - 1) mp[next] = i, ans += i - next - 2;
      next = i;
    }
  if (next < n) ans += n + 1 - next - 2, mp[next] = n + 1;
  for (i = 0; i < m; i++) {
    scanf("%d", &l);
    scanf("%s", a);
    if ((str[l] != '.') ^ (a[0] != '.')) {
      str[l] = a[0];
      if (a[0] == '.') {
        if (mp[l])
          mp[l - 1] = mp[l], mp.erase(mp.lower_bound(l)), ans++;
        else
          mp[l - 1] = l + 1;
        d = mp.lower_bound(l - 1);
        if (d == mp.begin()) {
          printf("%d\n", ans);
          continue;
        }
        d--;
        if (d->second == l) d->second = mp[l - 1], mp.erase(++d), ans++;
        printf("%d\n", ans);
      } else {
        d = mp.lower_bound(l);
        d--;
        if (d->first == d->second - 2) {
          printf("%d\n", ans);
          mp.erase(d);
          continue;
        }
        if (d->first == l - 1) {
          mp[l] = d->second;
          mp.erase(d);
          ans--;
          printf("%d\n", ans);
          continue;
        }
        if (d->second == l + 1) {
          d->second = l;
          ans--;
          printf("%d\n", ans);
          continue;
        }
        mp[l] = d->second;
        d->second = l;
        ans = ans - 2;
        printf("%d\n", ans);
      }
    } else
      printf("%d\n", ans);
  }
}
