#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b;
  cin >> a >> b;
  string s;
  cin >> s;
  map<long long, long long> arr;
  long long index = 0;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == '.' && (i == 0 || s[i - 1] != '.')) {
      index = i;
    }
    if (s[i] == '.' && (i == s.length() - 1 || s[i + 1] != '.')) arr[index] = i;
  }
  map<long long, long long>::iterator it, it1, it2, it3;
  long long sum = 0;
  for (it = arr.begin(); it != arr.end(); it++) {
    sum = sum + (*it).second - (*it).first;
  }
  for (int i = 0; i < b; i++) {
    int a1;
    cin >> a1;
    char c1;
    cin >> c1;
    a1 = a1 - 1;
    if ((c1 == '.' && s[a1] != '.') || (c1 != '.' && s[a1] == '.')) {
      if (c1 != '.') {
        if (s[a1 + 1] == '.' && (a1 == 0 || s[a1 - 1] != '.'))
          sum = sum - 1;
        else if ((a1 == s.length() - 1 || s[a1 + 1] != '.') && s[a1 - 1] == '.')
          sum = sum - 1;
        else if (s[a1 + 1] == '.' && s[a1 - 1] == '.') {
          sum = sum - 2;
        }
        s[a1] = c1;
      } else {
        if (s[a1 + 1] == '.') sum = sum + 1;
        if (s[a1 - 1] == '.') sum = sum + 1;
        s[a1] = c1;
      }
    }
    cout << sum << endl;
  }
  return 0;
}
