#include <bits/stdc++.h>
using namespace std;
const int maxn = 300000 + 100;
string s;
int main() {
  int n, q;
  cin >> n >> q;
  cin >> s;
  int res = 0;
  for (int i = 1; i < n; i++)
    if (s[i] == '.' && s[i - 1] == '.') res++;
  while (q--) {
    int x;
    char c;
    cin >> x >> c;
    x--;
    if ((c == '.' && s[x] == '.') || (c != '.' && s[x] != '.')) {
      cout << res << endl;
      continue;
    }
    if (c == '.') {
      if (x + 1 < s.size() && s[x + 1] == '.') res++;
      if (x - 1 >= 0 && s[x - 1] == '.') res++;
    } else {
      if (x + 1 < s.size() && s[x + 1] == '.') res--;
      if (x - 1 >= 0 && s[x - 1] == '.') res--;
    }
    s[x] = c;
    cout << res << endl;
  }
}
