#include <bits/stdc++.h>
using namespace std;
int f(const string &s) {
  int res = 0;
  for (size_t i = 0; i < s.length() - 1; i++) {
    if (s[i] == '.' && s[i + 1] == '.') {
      res++;
    }
  }
  return res;
}
void solve() {
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  int fres = f(s);
  for (int i = 0; i < m; i++) {
    int k;
    char c;
    cin >> k >> c;
    k--;
    if (c != '.') {
      if (s[k] == '.') {
        if (s[k + 1] == '.') {
          fres--;
        }
        if (s[k - 1] == '.') {
          fres--;
        }
      }
    } else {
      if (s[k] != '.') {
        if (s[k - 1] == '.') {
          fres++;
        }
        if (s[k + 1] == '.') {
          fres++;
        }
      }
    }
    s[k] = c;
    cout << fres << endl;
  }
}
int main() { solve(); }
