#include <bits/stdc++.h>
using namespace std;
const int INF = int(1e9);
const long long INFll = 1ll * INF * INF;
const int MOD = 1000000007;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  int cur = 0;
  for (int i = 0; i < n; ++i)
    if (s[i] == s[i - 1] && s[i] == '.') cur++;
  while (m--) {
    int p;
    char c;
    cin >> p >> c;
    p--;
    if (c == '.') {
      if (s[p] == '.') {
        cout << cur << endl;
        continue;
      }
      s[p] = c;
      if (p + 1 < n && s[p + 1] == '.') cur++;
      if (p - 1 >= 0 && s[p - 1] == '.') cur++;
    } else {
      if (s[p] != '.') {
        cout << cur << endl;
        continue;
      }
      s[p] = c;
      if (p + 1 < n && s[p + 1] == '.') cur--;
      if (p - 1 >= 0 && s[p - 1] == '.') cur--;
    }
    cout << cur << endl;
  }
  if (0) cerr << "\nTIME = " << clock() << "\n";
  return 0;
}
