#include <bits/stdc++.h>
using namespace std;
const long long N = 3e5 + 5;
long long n, m, ans = 0;
char a[N];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  a[0] = a[n + 1] = '?';
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) ans += (a[i] == '.' && a[i + 1] == '.');
  while (m--) {
    long long x;
    char ch;
    cin >> x >> ch;
    if (ch == '.' && a[x] != ch) {
      a[x] = '.';
      ans += (a[x - 1] == '.');
      ans += (a[x + 1] == '.');
    } else if (ch != '.' && a[x] == '.') {
      a[x] = ch;
      ans -= (a[x - 1] == '.');
      ans -= (a[x + 1] == '.');
    }
    cout << ans << "\n";
  }
  return 0;
}
