#include <bits/stdc++.h>
using namespace std;
long long int logy(long long int x, long long int y) {
  return ceil((long double)(log(x) / log(y)));
}
long long int powe(long long int a, long long int b) {
  long long int re = 1;
  while (b) {
    if (b & 1) re = (re * a);
    a = (a * a);
    b = b >> 1;
  }
  return re;
}
bool flag = 0, flag1 = 0, flag2 = 0;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, tt, ans = 0;
  cin >> n >> tt;
  string ss;
  cin >> ss;
  long long int l = -1, r = -1;
  for (long long int i = 0; i < n; i++) {
    if (ss[i] == '.') {
      l = r = i;
      while (i + 1 < n && ss[i + 1] == '.') r++, i++;
      if (r - l + 1 >= 2) ans += r - l;
    }
  }
  ss = 'Z' + ss + 'Z';
  while (tt--) {
    long long int pos;
    char c;
    cin >> pos >> c;
    if ((ss[pos] == '.' && c == '.') || (ss[pos] != '.' && c != '.'))
      ;
    else if (c == '.') {
      if (ss[pos - 1] != '.' && ss[pos + 1] == '.')
        ans++;
      else if (ss[pos - 1] == '.' && ss[pos + 1] != '.')
        ans++;
      else if (ss[pos - 1] == '.' && ss[pos + 1] == '.')
        ans += 2;
      ss[pos] = '.';
    } else {
      if (ss[pos - 1] != '.' && ss[pos + 1] == '.')
        ans--;
      else if (ss[pos - 1] == '.' && ss[pos + 1] != '.')
        ans--;
      else if (ss[pos - 1] == '.' && ss[pos + 1] == '.')
        ans -= 2;
      ss[pos] = c;
    }
    cout << ans << "\n";
  }
  return 0;
}
