#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  long long n, m;
  long long ar[53210];
  long long a;
  cin >> n >> m;
  long long c = 0;
  cin >> s;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == s[i + 1] and s[i] == '.') c++;
  }
  while (m--) {
    char ch;
    cin >> a;
    cin >> ch;
    a--;
    if (ch == '.' and s[a] == '.') {
      cout << c << endl;
      continue;
    }
    if (ch != '.' and s[a] != '.') {
      cout << c << endl;
      continue;
    }
    if (ch == '.') {
      if (a - 1 >= 0 and s[a - 1] == '.') {
        c++;
      }
      if (a + 1 < n and s[a + 1] == '.') {
        c++;
      }
      s[a] = ch;
    }
    if (ch != '.') {
      if (a - 1 >= 0 and s[a - 1] == '.') {
        c--;
      }
      if (a + 1 < n and s[a + 1] == '.') {
        c--;
      }
      s[a] = ch;
    }
    cout << c << endl;
  }
}
