#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  char a[300005];
  cin >> a + 1;
  a[0] = 'a';
  a[n + 1] = 'b';
  int jie = 0;
  for (int i = 2; i <= n; i++) {
    if (a[i] == a[i - 1] && a[i] == '.') {
      jie++;
    }
  }
  int k[300004];
  char b;
  int num;
  for (int i = 1; i <= m; i++) {
    cin >> num >> b;
    int qian = 0;
    int hou = 0;
    if (a[num - 1] == a[num] && a[num] == '.') {
      qian++;
    }
    if (a[num + 1] == a[num] && a[num] == '.') {
      qian++;
    }
    if (a[num - 1] == b && b == '.') {
      hou++;
    }
    if (a[num + 1] == b && b == '.') {
      hou++;
    }
    jie = jie - qian + hou;
    k[i] = jie;
    a[num] = b;
  }
  for (int i = 1; i <= m; i++) {
    cout << k[i] << endl;
  }
}
