#include <bits/stdc++.h>
using namespace std;
struct comp {
  bool operator()(int &a, int &b) {
    if (a < b)
      return false;
    else
      return true;
  }
};
int main() {
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  int num = 0, groups = 0;
  bool *arr = new bool[s.length() + 2];
  for (int i = 0; i <= (s.length() + 1); i++) {
    arr[i] = false;
  }
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '.') {
      num++;
      if (i == 0 || !arr[i]) groups++;
      arr[i + 1] = true;
    }
  }
  for (int j = 0; j < m; j++) {
    int i;
    char c;
    cin >> i >> c;
    bool a = arr[i], b = (c == '.');
    if (a != b) {
      if (a) {
        num--;
      } else {
        num++;
      }
      if (!b && arr[i - 1] && arr[i + 1]) {
        groups++;
      }
      if (!b && !arr[i - 1] && !arr[i + 1]) {
        groups--;
      }
      if (b && arr[i - 1] && arr[i + 1]) {
        groups--;
      }
      if (b && !arr[i - 1] && !arr[i + 1]) {
        groups++;
      }
    }
    arr[i] = b;
    cout << (num - groups) << '\n';
  }
  return 0;
}
