#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans % m;
}
int ind[300005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  int cnt = 0, grp = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      cnt++;
      if (i == 0 || s[i - 1] != '.') grp++;
      ind[i + 1] = 1;
    }
  }
  int x;
  char ch;
  for (int i = 0; i < m; i++) {
    cin >> x >> ch;
    int a = ind[x];
    int b = (ch == '.');
    if (a != b) {
      if (b)
        cnt++;
      else
        cnt--;
      if (ind[x - 1] && ind[x + 1] && !b) grp++;
      if (ind[x - 1] && ind[x + 1] && b) grp--;
      if (!ind[x - 1] && !ind[x + 1] && !b) grp--;
      if (!ind[x - 1] && !ind[x + 1] && b) grp++;
    }
    ind[x] = b;
    cout << (cnt - grp) << "\n";
  }
}
