#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  int ans = 0;
  int ind = -1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '.') {
      if (ind == -1) ind = i;
    } else {
      if (ind != -1) {
        ans += (i - ind - 1);
        ind = -1;
      }
    }
  }
  if (ind != -1) {
    ans += (n - ind - 1);
  }
  while (m--) {
    int in;
    char ch;
    cin >> in >> ch;
    in--;
    if (ch == '.' && (s[in] >= 97 && s[in] <= 122)) {
      if ((in != 0 || in != (n - 1)) && (s[in - 1] == '.' && s[in + 1] == '.'))
        ans += 2;
      else if (in != (n - 1) && s[in + 1] == '.')
        ans += 1;
      else if (in != 0 && s[in - 1] == '.')
        ans += 1;
    } else if ((ch >= 97 && ch <= 122) && s[in] == '.') {
      if ((in != 0 || in != (n - 1)) && (s[in - 1] == '.' && s[in + 1] == '.'))
        ans -= 2;
      else if (in != (n - 1) && s[in + 1] == '.')
        ans -= 1;
      else if (in != 0 && s[in - 1] == '.')
        ans -= 1;
    }
    s[in] = ch;
    cout << ans << "\n";
  }
  return 0;
}
