#include <bits/stdc++.h>
using namespace std;
const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int MAX = 2 * 1000 * 1000 + 10;
const long long INF = 1e18;
const int MOD = 1e9 + 7;
bool ar[MAX];
int ans = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') ar[i] = 1;
  }
  for (int i = 0; i < n; i++) {
    if (ar[i] and ar[i + 1]) ans++;
  }
  while (m--) {
    int x;
    char c;
    cin >> x >> c;
    x--;
    if (c == '.') {
      if (ar[x] == 1) {
        cout << ans << '\n';
        continue;
      } else {
        ar[x] = 1;
        ans++;
        if (x > 0 and ar[x - 1]) ans++;
        if (ar[x + 1] == 0) ans--;
      }
    } else {
      if (ar[x] == 0) {
        cout << ans << '\n';
        continue;
      } else {
        ar[x] = 0;
        ans--;
        if (x > 0 and ar[x - 1]) ans--;
        if (ar[x + 1] == 0) ans++;
      }
    }
    cout << ans << '\n';
  }
}
