#include <bits/stdc++.h>
using namespace std;
char str[3000000];
int main() {
  int n, m;
  cin >> n >> m;
  scanf("%s", str);
  int res = 0;
  for (int i = 0; i < n - 1; i++) {
    if (str[i] == '.' && str[i + 1] == '.') {
      res++;
    }
  }
  int x;
  char c;
  for (int i = 0; i < m; i++) {
    int count = res;
    cin >> x >> c;
    if (str[x - 1] == '.' && c != '.') {
      if (str[x - 2] == '.') {
        count--;
      }
      if (str[x] == '.') {
        count--;
      }
    } else if (str[x - 1] != '.' && c == '.') {
      if (str[x - 2] == '.') {
        count++;
      }
      if (str[x] == '.') {
        count++;
      }
    }
    cout << count << endl;
    res = count;
    str[x - 1] = c;
  }
  return 0;
}
