#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
int a[N];
int n, q;
int valu;
int quan;
void Enter() {
  string S;
  cin >> n >> q >> S;
  for (int i = 0; i < n; i++)
    if (S[i] == '.')
      a[i + 1] = 1;
    else
      a[i + 1] = 2;
  a[0] = a[n + 1] = 2;
}
void Prepa() {
  for (int i = 1; i <= n;) {
    if (a[i] == 2) {
      i++;
      continue;
    }
    valu++;
    int temp = a[i];
    while (temp == a[i] && i <= n) i++, quan++;
  }
}
void Solve() {
  int idex, type;
  char temp;
  while (q--) {
    cin >> idex >> temp;
    type = (temp == '.') ? 1 : 2;
    if (a[idex] != type) {
      if (type == 2) {
        quan--;
        if (a[idex - 1] * a[idex + 1] == 1) valu++;
        if (a[idex - 1] * a[idex + 1] == 4) valu--;
      }
      if (type == 1) {
        quan++;
        if (a[idex - 1] * a[idex + 1] == 4) valu++;
        if (a[idex - 1] * a[idex + 1] == 1) valu--;
      }
    }
    a[idex] = type;
    cout << quan - valu << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  Enter();
  Prepa();
  Solve();
  return 0;
}
