#include <bits/stdc++.h>
using namespace std;
const int N = int(3e5);
int n, m;
char ch[N + 3];
int ans = 0, a[N + 3];
void fnd() {
  for (int i = 1; i <= n; ++i) {
    if (ch[i] == '.') {
      if (ch[i - 1] == '.') {
        a[i]++;
        a[i - 1]++;
      }
    }
  }
  for (int i = 1; i <= n; ++i) {
    ans += a[i];
  }
}
void solve() {
  int num;
  char c;
  cin >> num >> c;
  if (ch[num] == '.' && ch[num - 1] == '.') {
    a[num]--;
    a[num - 1]--;
    ans -= 2;
  }
  if (ch[num] == '.' && ch[num + 1] == '.') {
    a[num]--;
    a[num + 1]--;
    ans -= 2;
  }
  ch[num] = c;
  if (ch[num] == '.') {
    if (ch[num - 1] == '.') {
      a[num]++;
      a[num - 1]++;
      ans += 2;
    }
    if (ch[num + 1] == '.') {
      a[num]++;
      a[num + 1]++;
      ans += 2;
    }
  }
  printf("%d\n", ans / 2);
}
int main() {
  memset(a, 0, sizeof(a));
  scanf("%d%d", &n, &m);
  ch[0] = 'e';
  ch[n + 1] = 'e';
  for (int i = 1; i <= n; ++i) {
    scanf(" %c", &ch[i]);
  }
  fnd();
  while (m--) {
    solve();
  }
  return 0;
}
