#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<char> s(n);
  for (int i = 0; i < n; i++) cin >> s[i];
  int base = 0;
  for (int i = 1; i < n; i++)
    if (s[i] == '.' && s[i - 1] == '.') base++;
  int x;
  char c;
  for (int i = 0; i < m; i++) {
    if (n == 1) {
      cout << 0 << endl;
      continue;
    }
    cin >> x >> c;
    x--;
    if (c == '.') {
      if (s[x] == '.') {
        cout << base << endl;
        continue;
      }
      if (x == 0)
        base += (int)(s[x + 1] == '.');
      else if (x == n - 1)
        base += (int)(s[x - 1] == '.');
      else
        base += (int)(s[x + 1] == '.') + (int)(s[x - 1] == '.');
      cout << base << endl;
    } else {
      if (s[x] != '.') {
        cout << base << endl;
        continue;
      }
      if (x == 0)
        base -= (int)(s[x + 1] == '.');
      else if (x == n - 1)
        base -= (int)(s[x - 1] == '.');
      else
        base -= (int)(s[x + 1] == '.') + (int)(s[x - 1] == '.');
      cout << base << endl;
    }
    s[x] = c;
  }
  return 0;
}
