#include <bits/stdc++.h>
using namespace std;
string s;
int n, m, x, cnt, sum, t, ans;
char c;
int main() {
  cin >> n >> m;
  cin >> s;
  cnt = 0;
  sum = 0;
  for (int(j) = (0); (j) <= (n - 2); (j)++) {
    if (s[j] == '.' && s[j + 1] == '.') sum++;
  }
  for (int(i) = (1); (i) <= (m); (i)++) {
    cin >> x >> c;
    t = x - 1;
    if (s[t] != '.' && c == '.') {
      s[t] = c;
      if (s[t - 1] == '.') sum++;
      if (s[t + 1] == '.') sum++;
    } else if (s[t] == '.' && c != '.') {
      s[t] = c;
      if (s[t - 1] == '.') sum--;
      if (s[t + 1] == '.') sum--;
    }
    cout << sum << endl;
  }
  return 0;
}
