#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483640;
const int MAXN = 1000005;
string w;
int n, m;
set<int> dots;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  cin >> w;
  w = "#" + w;
  for (int i = (1); i <= (n - 1); ++i)
    if (w[i] == '.' && w[i + 1] == '.') dots.insert(i);
  for (int i = 0; i < (m); ++i) {
    int x;
    char c;
    cin >> x >> c;
    w[x] = c;
    if (c != '.') {
      if (dots.find(x) != dots.end()) dots.erase(dots.find(x));
      if (dots.find(x - 1) != dots.end()) dots.erase(dots.find(x - 1));
    } else {
      if (x < n && w[x + 1] == '.') dots.insert(x);
      if (x > 1 && w[x - 1] == '.') dots.insert(x - 1);
    }
    cout << ((int)(dots).size()) << endl;
  }
  return 0;
}
