#include <bits/stdc++.h>
using namespace std;
double pi = acos(-1);
void Open() {}
int main() {
  Open();
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  string s;
  cin >> s;
  int counter = 0, num = 0;
  ;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '.')
      counter++;
    else {
      if (counter > 1) num += counter - 1;
      counter = 0;
    }
  }
  if (counter > 1) num += counter - 1;
  int j;
  char ch;
  while (k--) {
    cin >> j >> ch;
    j--;
    if (ch != '.' && s[j] != '.' || ch == '.' && s[j] == '.') {
      cout << num << "\n";
      continue;
    } else if (ch == '.') {
      if (j + 1 < n && j - 1 >= 0 && s[j + 1] == '.' && s[j - 1] == '.')
        num += 2;
      else if (((j + 1 < n) && s[j + 1] == '.' ||
                (j - 1 >= 0) && s[j - 1] == '.'))
        num += 1;
    } else {
      if (s[j + 1] == '.' && s[j - 1] == '.')
        num -= 2;
      else if (((j + 1 < n) && s[j + 1] == '.' ||
                (j - 1 >= 0) && s[j - 1] == '.'))
        num -= 1;
    }
    s[j] = ch;
    cout << num << "\n";
  }
}
