#include <bits/stdc++.h>
using namespace std;
const int INF = numeric_limits<int>::max();
const long long LINF = numeric_limits<long long>::max();
const double DINF = numeric_limits<double>::max();
double eps = 1e-2;
void solve() {
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  long long len = 0, am = 0;
  int strk = 0;
  for (int i = 0; i < (int)s.length(); ++i) {
    if (s[i] == '.') {
      if (!strk) ++am;
      ++len;
      ++strk;
      continue;
    }
    strk = 0;
  }
  while (m--) {
    int x;
    char ch;
    cin >> x >> ch;
    --x;
    if (n == 1) {
      cout << 0 << "\n";
      continue;
    }
    if (x == 0) {
      if (ch == '.' && s[x + 1] == '.' && isalpha(s[x]))
        ++len;
      else if (isalpha(ch) && s[x + 1] == '.' && s[x] == '.')
        --len;
    } else if (x == n - 1) {
      if (ch == '.' && s[x - 1] == '.' && isalpha(s[x]))
        ++len;
      else if (isalpha(ch) && s[x - 1] == '.' && s[x] == '.')
        --len;
    } else if (ch == '.' && isalpha(s[x])) {
      if (s[x - 1] == '.' && s[x + 1] == '.') {
        ++len;
        --am;
      } else if (s[x - 1] == '.' || s[x + 1] == '.')
        ++len;
    } else if (isalpha(ch) && s[x] == '.') {
      if (s[x - 1] == '.' && s[x + 1] == '.') {
        ++am;
        --len;
      } else if (s[x - 1] == '.' || s[x + 1] == '.')
        --len;
    }
    cout << len - am << "\n";
    s[x] = ch;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  for (int k = 0; k < t; ++k) {
    solve();
  }
  return 0;
}
