#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 11, mod = 1e9 + 7;
const int INF1 = 2e9;
const long long INF2 = 2e18;
const int base = 500;
const int P = 31;
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, 1, -1};
const double EPS = 1e-10;
const double PI = acos(-1.0);
int n, m, ct, group;
string s;
int main() {
  if (fopen("queue"
            ".in",
            "r"))
    freopen(
        "queue"
        ".in",
        "r", stdin),
        freopen(
            "queue"
            ".out",
            "w", stdout);
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> s;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == '.') {
      ++ct;
      if (s[i - 1] != '.' || !i) ++group;
    }
  }
  while (m--) {
    int id;
    char d;
    cin >> id >> d;
    --id;
    if (s[id] == '.' && d == '.' || s[id] != '.' && d != '.') {
      cout << ct - group << "\n";
      continue;
    }
    if (s[id] == '.' && d != '.') {
      --ct;
      s[id] = d;
      if (s[id + 1] == '.' && s[id - 1] == '.')
        group++;
      else if (s[id + 1] != '.' && s[id - 1] != '.')
        --group;
      cout << ct - group << "\n";
      continue;
    }
    if (s[id] != '.' && d == '.') {
      s[id] = d;
      ++ct;
      if (s[id - 1] != '.' && s[id + 1] != '.')
        ++group;
      else if (s[id - 1] == '.' && s[id + 1] == '.')
        --group;
      cout << ct - group << "\n";
      continue;
    }
  }
  return 0;
}
