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