#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, p, count, res;
  cin >> n >> m;
  string s;
  char c, o;
  cin >> s;
  res = 0;
  count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      count++;
    else {
      if (count != 0) {
        res += count - 1;
      }
      count = 0;
    }
  }
  if (count != 0) res += count - 1;
  for (int i = 0; i < m; i++) {
    cin >> p >> c;
    o = s[p - 1];
    s[p - 1] = c;
    if ((c == '.' && o == '.') || (c != '.' && o != '.')) {
      cout << res << endl;
      continue;
    }
    if (c == '.') {
      if (p == 1) {
        if (s[p] == '.') res++;
      } else if (p == s.length()) {
        if (s[p - 2] == '.') res++;
      } else {
        if (s[p] == '.') res++;
        if (s[p - 2] == '.') res++;
      }
    } else if (o == '.') {
      if (p == 1) {
        if (s[p] == '.') res--;
      } else if (p == s.length()) {
        if (s[p - 2] == '.') res--;
      } else {
        if (s[p] == '.') res--;
        if (s[p - 2] == '.') res--;
      }
    }
    cout << res << endl;
  }
  return 0;
}
