#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, x, count = 0, p;
  string s;
  char c;
  cin >> n >> m;
  cin >> s;
  for (i = 1; i < n; i++) {
    if (s.at(i) == 46 && s.at(i - 1) == 46) count++;
  }
  for (i = 0; i < m; i++) {
    cin >> x >> c;
    string str(1, c);
    x--;
    if (s.at(x) == '.' && c != '.' && n > 1) {
      p = 0;
      s.replace(x, 1, str);
      if (x == 0 && s.at(x + 1) == 46)
        p = 1;
      else if (x == n - 1 && s.at(x - 1) == 46)
        p = 1;
      else if (x != 0 && x != n - 1) {
        if (s.at(x - 1) == 46) p++;
        if (s.at(x + 1) == 46) p++;
      }
      count -= p;
    } else if (s.at(x) != '.' && c == '.' && n > 1) {
      p = 0;
      s.replace(x, 1, str);
      if (x == 0 && s.at(x + 1) == 46)
        p = 1;
      else if (x == n - 1 && s.at(x - 1) == 46)
        p = 1;
      else if (x != 0 && x != n - 1) {
        if (s.at(x - 1) == 46) p++;
        if (s.at(x + 1) == 46) p++;
      }
      count += p;
    } else
      s.replace(x, 1, str);
    cout << count << "\n";
  }
  return 0;
}
