#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool fs(T &x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
string s;
int tree[4 * 300015], n, q;
char ara[300005];
int init(int node, int b, int e) {
  if (b == e) {
    ara[b] = s[b - 1];
    return tree[node] = 0;
  }
  int left = node * 2;
  int right = left + 1;
  int mid = (b + e) / 2;
  int p = 0;
  int c = init(left, b, mid);
  int d = init(right, mid + 1, e);
  if (ara[mid] == ara[mid + 1] && ara[mid] == '.') p = 1;
  return tree[node] = c + d + p;
}
void query(int node, int b, int e, int i, int j, char x) {
  if (i > e || j < b) return;
  if (b >= i && e <= j) {
    ara[b] = x;
    tree[node] = 0;
    return;
  }
  int left = node * 2;
  int right = left + 1;
  int mid = (b + e) / 2;
  int p = 0;
  query(left, b, mid, i, j, x);
  query(right, mid + 1, e, i, j, x);
  if (ara[mid] == ara[mid + 1] && ara[mid] == '.') p = 1;
  tree[node] = tree[left] + tree[right] + p;
  return;
}
int main() {
  int i, j, k, a, b, c;
  char x;
  fs(n);
  fs(q);
  cin >> s;
  init(1, 1, n);
  for (i = 1; i <= q; i++) {
    cin >> a >> x;
    query(1, 1, n, a, a, x);
    printf("%d\n", tree[1]);
  }
  return 0;
}
