#include <bits/stdc++.h>
using namespace std;
const int N = 400;
bool check(char c1, char c2) { return true; }
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  int len = count(s.begin(), s.end(), '.');
  int comp = 0;
  for (int i = 0; i < n;) {
    if (s[i] == '.') {
      comp++;
      while (s[i] == '.' && i < n) i++;
    } else {
      s[i] = 'a';
      i++;
    }
  }
  s = 'a' + s;
  s = s + 'a';
  while (q-- > 0) {
    int pos;
    char c;
    cin >> pos >> c;
    if (c != '.') c = 'a';
    if (c == s[pos]) {
      s[pos] = c;
      cout << len - comp << endl;
      continue;
    }
    int x = (c == '.' ? 1 : -1);
    len = len + x;
    if (s[pos - 1] == s[pos + 1] && s[pos - 1] == '.')
      comp = comp - x;
    else if (s[pos - 1] == s[pos + 1] && s[pos - 1] != '.') {
      comp = comp + x;
    }
    s[pos] = c;
    cout << len - comp << endl;
  }
}
