#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, ans = 0;
  cin >> n >> m;
  char str[n + 1];
  str[0] = 'a', str[n + 1] = 'a';
  for (int i = 1; i <= n; i++) cin >> str[i];
  for (long long i = 1; i < n; i++)
    if (str[i] == '.' && str[i + 1] == '.') ans++;
  while (m--) {
    int x;
    char ch;
    scanf("%d %c", &x, &ch);
    if (ch == '.' && str[x] != '.') {
      str[x] = '.';
      if (str[x - 1] == '.') ans++;
      if (str[x + 1] == '.') ans++;
    }
    if (ch != '.' && str[x] == '.') {
      str[x] = ch;
      if (str[x - 1] == '.') ans--;
      if (str[x + 1] == '.') ans--;
    }
    printf("%d\n", ans);
  }
}
