#include <bits/stdc++.h>
using namespace std;
string str;
int replace(int k, char ch) {
  if (ch == '.') {
    if (str[k] == '.') return 0;
    if (str[k - 1] == '.' && str[k + 1] == '.') return 2;
    if (str[k - 1] == '.' || str[k + 1] == '.') return 1;
    return 0;
  } else {
    if (str[k] != '.') return 0;
    if (str[k - 1] == '.' && str[k + 1] == '.') return -2;
    if (str[k - 1] == '.' || str[k + 1] == '.') return -1;
    return 0;
  }
}
int main() {
  int n, m, index, total = 0;
  char c;
  cin >> n >> m >> str;
  for (int i = 0; i < str.size() - 1; i++) {
    if (str[i] == '.' && str[i + 1] == '.') ++total;
  }
  for (int i = 0; i < m; i++) {
    cin >> index >> c;
    total += replace(index - 1, c);
    str[index - 1] = c;
    cout << total << '\n';
  }
  return 0;
}
