#include <bits/stdc++.h>
using namespace std;
int boobs(string s) {
  int n = s.length();
  int i = 0;
  int total = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '.' && s[i + 1] == '.') total++;
  }
  return total;
}
int main() {
  int n, m;
  cin >> n >> m;
  string s;
  cin >> s;
  int a;
  char c;
  int i = 0;
  int j = 0;
  int x = boobs(s);
  for (i = 1; i <= m; i++) {
    cin >> a >> c;
    if (s[a - 1] != '.' && c != '.')
      cout << x << endl;
    else if (s[a - 1] != '.' && c == '.') {
      s[a - 1] = c;
      if (s[a - 2] == '.' && s[a] == '.')
        x = x + 2;
      else if (s[a - 2] != '.' && s[a] != '.')
        x = x;
      else
        x++;
      cout << x << endl;
    } else if (s[a - 1] == '.' && c == '.')
      cout << x << endl;
    else {
      s[a - 1] = c;
      if (s[a - 2] == '.' && s[a] == '.')
        x = x - 2;
      else if (s[a - 2] != '.' && s[a] != '.')
        x = x;
      else
        x--;
      cout << x << endl;
    }
  }
  return 0;
}
