#include <bits/stdc++.h>
using namespace std;
int t[12000000], a[300001];
void built(int v, int l, int r, int c) {
  if (l == r) {
    t[v] = a[l];
  } else {
    int mid = (l + r) / 2;
    built(v * 2, l, mid, c);
    built(v * 2 + 1, mid + 1, r, c);
    t[v] = t[v * 2] + t[v * 2 + 1];
  }
}
void update(int v, int pos, int val, int l, int r) {
  if (pos == l && pos == r)
    t[v] = val;
  else {
    int mid = (l + r) / 2;
    if (pos <= mid)
      update(v * 2, pos, val, l, mid);
    else
      update(v * 2 + 1, pos, val, mid + 1, r);
    t[v] = t[v * 2] + t[v * 2 + 1];
  }
}
int main() {
  int n, m, x, x2, i, kolvo;
  char c;
  string s;
  cin >> n >> m;
  cin >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '.')
      a[i] = 1;
    else
      a[i] = 0;
  }
  i = 0;
  kolvo = 0;
  while (i < n) {
    if (s[i] != '.')
      i++;
    else {
      while (i < n && s[i] == '.') i++;
      kolvo++;
      i++;
    }
  }
  built(1, 0, n - 1, n);
  for (i = 0; i < m; i++) {
    cin >> x >> c;
    x--;
    if (c == '.')
      x2 = 1;
    else
      x2 = 0;
    update(1, x, x2, 0, n - 1);
    if (x2 == 1) {
      if (a[x] != x2) {
        if ((x == 0 && x + 1 < n && a[x + 1] == 0) ||
            (x + 1 == n && x - 1 >= 0 && a[x - 1] == 0) ||
            (x + 1 < n && x - 1 >= 0 && a[x + 1] == 0 && a[x - 1] == 0))
          kolvo++;
        else {
          if (x + 1 < n && x - 1 >= 0 && a[x - 1] == 1 && a[x + 1] == 1)
            kolvo--;
        }
      }
    } else {
      if (a[x] != x2) {
        if ((x == 0 && x + 1 < n && a[x + 1] == 0) ||
            (x + 1 == n && x - 1 >= 0 && a[x - 1] == 0) ||
            (x + 1 < n && x - 1 >= 0 && a[x + 1] == 0 && a[x - 1] == 0))
          kolvo--;
        else {
          if (x + 1 < n && x - 1 >= 0 && a[x + 1] == 1 && a[x - 1] == 1)
            kolvo++;
        }
      }
    }
    a[x] = x2;
    cout << max(t[1] - kolvo, 0) << '\n';
  }
  return 0;
}
