#include <bits/stdc++.h>
using namespace std;
int n;
int q;
bool check[300007];
int num;
int grp;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  clock_t t1, t2;
  t1 = clock();
  cin >> n >> q;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      num++;
      if (i == 0 || s[i - 1] != '.') {
        grp++;
      }
      check[i + 1] = true;
    }
  }
  for (int i = 1; i <= q; i++) {
    int ind;
    char c;
    cin >> ind >> c;
    bool ch = check[ind];
    bool tp;
    if (c == '.') {
      tp = true;
    } else {
      tp = false;
    }
    if (ch != tp) {
      if (ch) {
        num--;
      } else {
        num++;
      }
      if (check[ind - 1] && check[ind + 1] && !tp) {
        grp++;
      }
      if (check[ind - 1] && check[ind + 1] && tp) {
        grp--;
      }
      if (!check[ind - 1] && !check[ind + 1] && !tp) {
        grp--;
      }
      if (!check[ind - 1] && !check[ind + 1] && tp) {
        grp++;
      }
    }
    if (tp) {
      check[ind] = 1;
    } else {
      check[ind] = 0;
    }
    cout << num - grp << "\n";
  }
  t2 = clock();
  float diff = (float)t2 - (float)t1;
  float execution_time = diff / CLOCKS_PER_SEC;
}
