#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  long long c = 0, v = 0, f = 0;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == '.') {
      c++;
      f = 1;
    }
    if (s[i] != '.' and f == 1) {
      v += c - 1;
      c = 0;
      f = 0;
    }
  }
  if (c > 0) v += c - 1;
  while (m--) {
    long long a;
    char p;
    cin >> a >> p;
    a--;
    if (p != '.' and s[a] == '.') {
      if (a > 0 and a < s.size() - 1 and s[a - 1] == '.' and s[a + 1] == '.')
        v -= 2;
      else if (a == 0 and s[a + 1] == '.')
        v--;
      else if (a == n - 1 and s[a - 1] == '.')
        v--;
      else if (s[a - 1] == '.' or s[a + 1] == '.')
        v--;
      s[a] = p;
    } else if (p == '.' and s[a] != '.') {
      if (a > 0 and a < s.size() - 1 and s[a - 1] == '.' and s[a + 1] == '.')
        v += 2;
      else if (a == 0 and s[a + 1] == '.')
        v++;
      else if (a == n - 1 and s[a - 1] == '.')
        v++;
      else if (s[a - 1] == '.' or s[a + 1] == '.')
        v++;
      s[a] = p;
    }
    cout << v << endl;
  }
}
