#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int N, M;
string s;
int main(void) {
  cin >> N >> M >> s;
  int cnt = 0;
  for (int i = 0; i < (int)(N - 1); ++i)
    if (s[i] == '.' and s[i + 1] == '.') cnt++;
  for (int mmm = 0; mmm < (int)(M); ++mmm) {
    int i;
    char c;
    cin >> i >> c;
    i--;
    if (c == '.' and s[i] != '.') {
      if (i > 0 and s[i - 1] == '.') cnt++;
      if (i < N - 1 and s[i + 1] == '.') cnt++;
    }
    if (c != '.' and s[i] == '.') {
      if (i > 0 and s[i - 1] == '.') cnt--;
      if (i < N - 1 and s[i + 1] == '.') cnt--;
    }
    s[i] = c;
    cout << cnt << endl;
  }
  return 0;
}
