#include <bits/stdc++.h>
char _;
using namespace std;
const int MAXN = 300005;
char ch;
int num[MAXN], first[MAXN], N, Q, ans, pos;
char seq[MAXN];
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> Q;
  for (int i = 1; i <= N; i++) {
    cin >> seq[i];
    if (seq[i] == '.') {
      if (seq[i - 1] == '.') ans++;
    }
  }
  for (int i = 1; i <= Q; i++) {
    cin >> pos >> ch;
    if (ch == '.') {
      if (seq[pos] != '.') {
        if (seq[pos - 1] == '.') ans++;
        if (seq[pos + 1] == '.') ans++;
      }
    } else {
      if (seq[pos] == '.') {
        if (seq[pos - 1] == '.') ans--;
        if (seq[pos + 1] == '.') ans--;
      }
    }
    printf("%d\n", ans);
    seq[pos] = ch;
  }
}
