#include <bits/stdc++.h>
using namespace std;
struct abc {
  long long int x, y;
};
bool compare(abc a1, abc a2) {
  if (a1.x == a2.x) return a1.y > a2.y;
  return a1.x < a2.x;
}
const long long int mod = 1e9 + 7;
long long int a[200005];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, m, c = 0, x;
  string s;
  char ch;
  cin >> n >> m >> s;
  for (long long int i = 1; i < n; i++) {
    if (s[i] == s[i - 1] && s[i] == '.') c++;
  }
  while (m--) {
    cin >> x >> ch;
    x--;
    if (ch == '.') {
      if (s[x] == '.')
        cout << c;
      else {
        if (x != 0)
          if (s[x - 1] == '.') c++;
        if (x != s.size() - 1)
          if (s[x + 1] == '.') c++;
        cout << c;
      }
    } else if (s[x] != '.')
      cout << c;
    else {
      if (x != 0) {
        if (s[x - 1] == '.') c--;
      }
      if (x != s.size() - 1) {
        if (s[x + 1] == '.') c--;
      }
      cout << c;
    }
    s[x] = ch;
    cout << endl;
  }
}
