#include <bits/stdc++.h>
#pragma optimize("Ofast")
using namespace std;
using ll = long long;
const int N = 1e5 + 5;
int main() {
  ios_base::sync_with_stdio(0);
  int n, m;
  string s;
  cin >> n >> m >> s;
  int ans = 0;
  for (int i = 0; i < n - 1; ++i) {
    if (s[i] == s[i + 1] && s[i] == '.') {
      ++ans;
    }
  }
  while (m--) {
    int idx;
    char ch;
    cin >> idx >> ch;
    --idx;
    if (s[idx] == '.' && idx > 0 && s[idx - 1] == '.') --ans;
    if (s[idx] == '.' && idx + 1 < n && s[idx + 1] == '.') --ans;
    s[idx] = ch;
    if (s[idx] == '.' && idx > 0 && s[idx - 1] == '.') ++ans;
    if (s[idx] == '.' && idx + 1 < n && s[idx + 1] == '.') ++ans;
    cout << ans << "\n";
  }
  return 0;
}
