#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, m, i, x, d, t;
  char c;
  string st;
  cin >> n >> m >> st;
  d = 0;
  for (i = 1; i < n; i++)
    if (st[i] == '.' & st[i - 1] == '.') d++;
  for (i = 1; i <= m; i++) {
    cin >> x >> c;
    x--;
    t = 0;
    if (c != '.') {
      if (st[x] == '.') t = -1;
    } else if (st[x] != '.')
      t = 1;
    st[x] = c;
    if (x > 0)
      if (st[x - 1] == '.') d += t;
    if (x < n - 1)
      if (st[x + 1] == '.') d += t;
    cout << d << endl;
  }
}
