#include <bits/stdc++.h>
using namespace std;
char s[300000 + 1];
int n;
int getans() {
  int ans = 0;
  int i = 0, j = 0;
  while (i < n && s[i] != '.') i++;
  while (i < n) {
    j = i + 1;
    if (s[i] == '.') {
      while (j < n && s[j] == '.') {
        ans++;
        j++;
      }
      if (j == n) return ans;
    }
    i = j;
  }
  return ans;
}
int makedot(int x) {
  if (s[x] == '.') return 0;
  s[x] = '.';
  if (x != 0 && x != n - 1) {
    if (s[x - 1] == '.' && s[x + 1] == '.') {
      return 2;
    }
    if (s[x - 1] == '.' || s[x + 1] == '.') {
      return 1;
    }
    return 0;
  }
  if (x == 0) {
    if (s[1] == '.')
      return 1;
    else
      return 0;
  }
  if (x == n - 1) {
    if (s[n - 2] == '.') return 1;
    return 0;
  }
}
int makech(int x) {
  if (s[x] != '.') return 0;
  s[x] = 'a';
  if (x != 0 && x != n - 1) {
    if (s[x - 1] == '.' && s[x + 1] == '.') {
      return -2;
    }
    if (s[x - 1] == '.' || s[x + 1] == '.') {
      return -1;
    }
    return 0;
  }
  if (x == 0) {
    if (s[1] == '.')
      return -1;
    else
      return 0;
  }
  if (x == n - 1) {
    if (s[n - 2] == '.') return -1;
    return 0;
  }
}
int main() {
  int m;
  cin >> n >> m;
  int ans = 0;
  scanf("%s", s);
  ans = getans();
  int x;
  char ch;
  int nm;
  while (m--) {
    scanf("%d %c", &x, &ch);
    x--;
    if (ch == '.') {
      nm = makedot(x);
      if (nm == 2)
        ans += 2;
      else if (nm == 1)
        ans += 1;
      else
        ans += 0;
      printf("%d\n", ans);
    } else {
      nm = makech(x);
      if (nm == -1)
        ans--;
      else if (nm == 0)
        ans += 0;
      else if (nm == -2)
        ans -= 2;
      printf("%d\n", ans);
    }
  }
}
