#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 1;
int tree[4 * N], n, m, l, r, pos;
char ch[N], c;
void build(int v, int l, int r) {
  if (l == r) {
    tree[v] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  build(v + v, l, mid);
  build(v + v + 1, mid + 1, r);
  tree[v] = tree[v + v] + tree[v + v + 1];
  if (ch[mid] == ch[mid + 1] && ch[mid] == '.') ++tree[v];
}
void update(int v, int l, int r, int pos, char first) {
  if (l == r) {
    ch[pos] = first;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid)
    update(v + v, l, mid, pos, first);
  else
    update(v + v + 1, mid + 1, r, pos, first);
  tree[v] = tree[v + v] + tree[v + v + 1];
  if (ch[mid] == ch[mid + 1] && ch[mid] == '.') ++tree[v];
}
int get(int v, int l, int r, int L, int R) {
  if (r < L || l > R) return 0;
  if (l >= L && r <= R) return tree[v];
  int mid = (l + r) >> 1;
  return get(v + v, l, mid, L, R) + get(v + v + 1, mid + 1, r, L, R);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) cin >> ch[i];
  build(1, 1, n);
  while (m--) {
    cin >> pos >> c;
    update(1, 1, n, pos, c);
    printf("%d\n", get(1, 1, n, 1, n));
  }
}
