#include <bits/stdc++.h>
using namespace std;
int dcmp(double a, double b) {
  return fabs(a - b) <= 0.00000000000001 ? 0 : (a > b) ? 1 : -1;
}
vector<int> vis(300000 + 9);
int main() {
  int n, m, p, cnt = 0, i;
  char c;
  string s;
  cin >> n >> m >> s;
  for (i = 0; i < ((int)(s).size()); i++) {
    if (s[i] == '.' && s[i + 1] == '.') {
      cnt++;
    }
    if (s[i] == '.') vis[i] = 1;
  }
  while (m--) {
    cin >> p >> c;
    if (c != '.' && s[p - 1] == '.') {
      if (((p < n && vis[p] == 1) && (p - 2 < 0 || vis[p - 2] == 0)) ||
          ((p >= n || vis[p] != 1) && (p - 2 >= 0 && vis[p - 2] == 1))) {
        cnt--;
      } else if ((p < n && vis[p] == 1) && (p - 2 >= 0 && vis[p - 2] == 1)) {
        cnt -= 2;
      }
      vis[p - 1] = 0;
    } else if (c == '.' && s[p - 1] != '.') {
      if (((p < n && vis[p] == 1) && (p - 2 < 0 || vis[p - 2] == 0)) ||
          ((p >= n || vis[p] != 1) && (p - 2 >= 0 && vis[p - 2] == 1))) {
        cnt++;
      } else if ((p < n && vis[p] == 1) && (p - 2 >= 0 && vis[p - 2] == 1)) {
        cnt += 2;
      }
      vis[p - 1] = 1;
    }
    s[p - 1] = c;
    cout << cnt << endl;
  }
}
