#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int tc, kk = 1, n, m, x;
  string s;
  char ch;
  cin >> n >> m;
  cin >> s;
  int sl = s.size();
  int cnt = 0;
  for (int i = 1; i < sl; i++)
    if (s[i] == '.')
      if (s[i - 1] == '.') cnt++;
  while (m--) {
    cin >> x >> ch;
    x--;
    if (ch == '.') {
      if (s[x] != '.') {
        if (x > 0)
          if (s[x - 1] == '.') cnt++;
        if (x < sl - 1)
          if (s[x + 1] == '.') cnt++;
      }
    } else {
      if (s[x] == '.') {
        if (x > 0)
          if (s[x - 1] == '.') cnt--;
        if (x < sl - 1)
          if (s[x + 1] == '.') cnt--;
      }
    }
    s[x] = ch;
    cout << cnt << "\n";
  }
  return 0;
}
