#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
static void amax(T &x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
static void amin(T &x, U y) {
  if (x > y) x = y;
}
int main() {
  int i, n, m, x, ans, cnt;
  scanf("%d%d", &n, &m);
  ans = cnt = 0;
  string s;
  cin >> s;
  for (int i = 0; i < (n); i++) {
    if (s[i] != '.' && cnt) ans += cnt - 1, cnt = 0;
    if (s[i] == '.') ++cnt;
  }
  if (cnt) ans += cnt - 1;
  for (int j = 0; j < (m); j++) {
    scanf("%d", &x);
    char c;
    cin >> c;
    if (c == '.' && s[x - 1] != '.') {
      if (s[x - 2] == '.') ++ans;
      if (s[x] == '.') ++ans;
    } else if (c != '.' && s[x - 1] == '.') {
      if (s[x - 2] == '.') --ans;
      if (s[x] == '.') --ans;
    }
    s[x - 1] = c;
    printf("%d\n", ans);
  }
  return 0;
}
