#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n >> m;
  long long i;
  long long a[n];
  string s;
  cin >> s;
  long long st = -1;
  long long res = 0;
  for (i = 0; i < n; i++) {
    if (s[i] != '.') {
      if (st != -1) {
        res += (i - st - 1);
      }
      st = -1;
    } else {
      if (st == -1) {
        st = i;
      }
    }
  }
  if (st != -1) {
    res += (n - 1 - st);
  }
  while (m--) {
    long long ps;
    char c;
    cin >> ps >> c;
    ps--;
    if (c == '.') {
      if (s[ps] == '.') {
        cout << res << "\n";
      } else {
        if (ps > 0 && s[ps - 1] == '.') {
          res++;
        }
        if (ps < n - 1 && s[ps + 1] == '.') {
          res++;
        }
        cout << res << "\n";
      }
    } else {
      if (s[ps] == '.') {
        if (ps > 0 && s[ps - 1] == '.') {
          res--;
        }
        if (ps < n - 1 && s[ps + 1] == '.') {
          res--;
        }
        cout << res << "\n";
      } else {
        cout << res << "\n";
      }
    }
    s[ps] = c;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
