#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, ans = 0, xx = 0, cn = 0;
  cin >> n >> m;
  vector<char> s(n + 2);
  s[0] = 'a';
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    if (s[i] == '.')
      xx++;
    else if (xx != 0)
      ans += (xx - 1), xx = 0;
  }
  if (xx != 0) ans += (xx - 1);
  s[n + 1] = 'a';
  char ch;
  for (int i = 0; i < m; i++) {
    int x1 = 1, x2 = 2;
    cin >> cn >> ch;
    if (s[cn] == '.' && ch != '.')
      x1 = -x1, x2 = -x2;
    else if ((s[cn] == '.' && ch == '.') || (s[cn] != '.' && ch != '.'))
      x1 = 0, x2 = 0;
    if ((s[cn - 1] == '.' && s[cn + 1] != '.') ||
        (s[cn - 1] != '.' && s[cn + 1] == '.'))
      ans += x1;
    else if (s[cn - 1] == '.' && s[cn + 1] == '.')
      ans += x2;
    s[cn] = ch;
    cout << ans << endl;
  }
  return 0;
}
