#include <bits/stdc++.h>
const int maxn = 1e6 + 10;
const int maxm = 1e5 + 10;
const int mod = 1e9 + 7;
const long long int INF = 1e18 + 100;
const int inf = 0x3f3f3f3f;
const double pi = acos(-1.0);
const double eps = 1e-8;
using namespace std;
int n, q;
char a[maxn];
int main() {
  cin >> n >> q;
  cin >> a + 1;
  int num = 0;
  int ans = 0;
  for (int i = 1; i <= n + 1; i++) {
    if (a[i] == '.')
      num++;
    else {
      if (num >= 2) ans += num - 1;
      num = 0;
    }
  }
  for (int i = 0; i < q; i++) {
    int flag = 0;
    int c;
    char d;
    cin >> c >> d;
    if (a[c] == '.')
      flag = 1;
    else
      flag = 0;
    if (d != '.' && flag == 1) {
      a[c] = d;
      if (a[c - 1] == '.' && a[c + 1] == '.') {
        printf("%d\n", ans - 2);
        ans -= 2;
      } else if (a[c - 1] == '.' && a[c + 1] != '.') {
        printf("%d\n", ans - 1);
        ans -= 1;
      } else if (a[c - 1] != '.' && a[c + 1] == '.') {
        printf("%d\n", ans - 1);
        ans -= 1;
      } else
        printf("%d\n", ans);
    } else if (d == '.' && flag == 1)
      printf("%d\n", ans);
    else if (d != '.' && flag != 1)
      printf("%d\n", ans);
    else {
      a[c] = d;
      if (a[c - 1] == '.') ans++;
      if (a[c + 1] == '.') ans++;
      printf("%d\n", ans);
    }
  }
}
