#include <bits/stdc++.h>
using namespace std;
const int N = 300010;
char s[N];
bool judge(char ch1, char ch2) {
  if (ch1 == ch2) return true;
  if ('a' <= ch1 && ch1 <= 'z' && 'a' <= ch2 && ch2 <= 'z') return true;
  return false;
}
int main() {
  int n, m, ans = 0, now = 0;
  scanf("%d%d%s", &n, &m, s);
  int len = strlen(s);
  for (int i = 0; i < len; i++) {
    if (s[i] == '.')
      now++;
    else
      now = 0;
    if (s[i] == '.' && s[i + 1] != '.') ans += now - 1;
  }
  for (int i = 0; i < m; i++) {
    int in;
    char t[3];
    scanf("%d%s", &in, t);
    in--;
    if (judge(t[0], s[in])) {
      printf("%d\n", ans);
      s[in] = t[0];
      continue;
    }
    if ('a' <= t[0] && t[0] <= 'z' && s[in] == '.') {
      int cnt = 0;
      if (in - 1 >= 0 && s[in - 1] == '.') cnt++;
      if (in + 1 < len && s[in + 1] == '.') cnt++;
      if (cnt == 1) ans--;
      if (cnt == 2) ans -= 2;
    } else {
      int cnt = 0;
      if (in - 1 >= 0 && s[in - 1] == '.') cnt++;
      if (in + 1 < len && s[in + 1] == '.') cnt++;
      if (cnt == 1) ans++;
      if (cnt == 2) ans += 2;
    }
    s[in] = t[0];
    printf("%d\n", ans);
  }
  return 0;
}
