#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[300 * 1000 + 10];
  bool check[300 * 1000 + 10];
  int n, m, k;
  char b;
  memset(check, 0, sizeof check);
  cin >> n >> m >> a;
  for (int i = 0; i < n; i++)
    if (a[i] == '.') check[i] = 1;
  int sum = 0;
  for (int i = 0; i < n - 1; i++)
    if (check[i] && check[i + 1]) sum++;
  for (int i = 0; i < m; i++) {
    cin >> k >> b;
    if (b != '.') {
      if (check[k - 1]) sum -= (check[k] + check[k - 2]);
      check[k - 1] = 0;
    } else {
      if (!check[k - 1]) sum += (check[k] + check[k - 2]);
      check[k - 1] = 1;
    }
    a[k - 1] = b;
    cout << sum << endl;
  }
  return 0;
}
