#include <bits/stdc++.h>
using namespace std;
char str[1000010];
long long int tree[10000010] = {};
long long int n, m;
long long int build_tree(long long int node, long long int a, long long int b) {
  if (a > b) return 0;
  if (a == b) {
    tree[node] = 0;
    return 0;
  }
  long long int x = build_tree(node * 2, a, (a + b) / 2);
  long long int y = build_tree(node * 2 + 1, 1 + (a + b) / 2, b);
  long long int idx = (a + b) / 2;
  tree[node] = x + y;
  if (idx < (n - 1) && str[idx] == '.' && str[idx + 1] == '.') tree[node]++;
  return tree[node];
}
long long int update_tree(long long int node, long long int a, long long int b,
                          long long int i) {
  if (a > b) return 0;
  if (a > i || b < i) return tree[node];
  if (a == b) {
    tree[node] = 0;
    return 0;
  }
  long long int x = update_tree(node * 2, a, (a + b) / 2, i);
  long long int y = update_tree(1 + node * 2, 1 + (a + b) / 2, b, i);
  long long int idx = (a + b) / 2;
  tree[node] = x + y;
  if (idx < (n - 1) && str[idx] == '.' && str[idx + 1] == '.') tree[node]++;
  return tree[node];
}
int main() {
  long long int i, l, k, j;
  cin >> n >> m;
  scanf("%s", str);
  build_tree(1, 0, n - 1);
  i = 1;
  while (m--) {
    char ch;
    cin >> k >> ch;
    str[k - 1] = ch;
    long long int ans = update_tree(1, 0, n - 1, k - 1);
    cout << ans << endl;
  }
  return 0;
}
