#include <bits/stdc++.h>
using namespace std;
using pii = pair<long long, long long>;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  string a;
  cin >> a;
  vector<long long> ar(n);
  long long len = 0, nb = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] == '.') ar[i] = 1;
  }
  for (long long i = 0; i < n; i++) {
    long long ind = i;
    while (ind < n && !ar[ind]) ind++;
    if (ind == n) break;
    long long ind1 = ind;
    while (ind1 < n && ar[ind1]) ind1++;
    len += ind1 - ind;
    nb++;
    i = ind1;
  }
  while (m--) {
    long long ind;
    char c;
    cin >> ind >> c;
    ind--;
    if (ar[ind] && c == '.') {
    } else if (!ar[ind] && c != '.') {
    } else if (c == '.') {
      ar[ind] = 1;
      len++;
      if ((ind == 0 || !ar[ind - 1]) && (ind == n - 1 || !ar[ind + 1]))
        nb++;
      else if ((ind > 0 && ar[ind - 1]) && (ind < n - 1 && ar[ind + 1]))
        nb--;
    } else {
      ar[ind] = 0;
      len--;
      if ((ind > 0 && ar[ind - 1]) && (ind < n - 1 && ar[ind + 1]))
        nb++;
      else if ((ind == 0 || !ar[ind - 1]) && (ind == n - 1 || !ar[ind + 1]))
        nb--;
    }
    cout << len - nb << "\n";
  }
  return 0;
}
