#include <bits/stdc++.h>
using namespace std;
string s;
int n, q;
int right(int x) { return (x << 1) + 1; }
int left(int x) { return x << 1; }
struct node {
  int ans;
  bool pre;
  bool next;
};
struct node tree[1200001];
struct node combine(struct node l, struct node r) {
  struct node temp;
  temp.pre = false;
  temp.next = false;
  temp.ans = l.ans + r.ans;
  if (r.next == true) temp.next = true;
  if (l.pre == true) temp.pre = true;
  if (l.next == true && r.pre == true) temp.ans = temp.ans + 1;
  return temp;
}
void build(int cur, int l, int r) {
  int mid = l + (r - l) / 2;
  if (l == r) {
    tree[cur].ans = 0;
    if (s[l] == '.') {
      tree[cur].pre = true;
      tree[cur].next = true;
    } else {
      tree[cur].pre = false;
      tree[cur].next = false;
    }
    return;
  }
  build(left(cur), l, mid);
  build(right(cur), mid + 1, r);
  tree[cur] = combine(tree[left(cur)], tree[right(cur)]);
}
void update(int cur, int l, int r, int ind, char c) {
  int mid = l + (r - l) / 2;
  if (l == r) {
    tree[cur].ans = 0;
    tree[cur].next = false;
    tree[cur].pre = false;
    if (c == '.') {
      tree[cur].next = true;
      tree[cur].pre = true;
    }
    return;
  } else if (ind <= mid) {
    update(left(cur), l, mid, ind, c);
  } else if (ind > mid) {
    update(right(cur), mid + 1, r, ind, c);
  }
  tree[cur] = combine(tree[left(cur)], tree[right(cur)]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> q;
  cin >> s;
  build(1, 0, n - 1);
  for (int i = 0; i < q; i++) {
    int a;
    char x;
    cin >> a >> x;
    update(1, 0, n - 1, a - 1, x);
    cout << tree[1].ans << endl;
  }
  return 0;
}
