#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 3e+5;
bool vis[MAX_N] = {0};
char t = '.';
int main() {
  int n, m, ans = 0, cnt = 0;
  string str;
  cin >> n >> m >> str;
  for (int i = 0; i < n; i++) {
    if (str[i] == t) {
      ans++;
      if (i == 0 || str[i - 1] != t) cnt++;
      vis[i + 1] = 1;
    }
  }
  while (m--) {
    int i;
    char ch;
    cin >> i >> ch;
    bool a = vis[i], b = ch == t;
    if (a != b) {
      if (a)
        ans--;
      else
        ans++;
      if (vis[i - 1] && vis[i + 1] && !b)
        cnt++;
      else if (vis[i - 1] && vis[i + 1] && b)
        cnt--;
      else if (!vis[i - 1] && !vis[i + 1] && !b)
        cnt--;
      else if (!vis[i - 1] && !vis[i + 1] && b)
        cnt++;
    }
    vis[i] = b;
    cout << ans - cnt << endl;
  }
  return 0;
}
