#include <bits/stdc++.h>
using namespace std;
unsigned long long counting(string input) {
  unsigned long long count = 0, result = 0;
  unsigned long long end = input.length() - 1;
  for (unsigned long long i = 1; i <= end; i++) {
    if (input[i] == '.' && input[i - 1] == '.') ++count;
  }
  return count;
}
int main(int argc, char const *argv[]) {
  unsigned long long len, q;
  cin >> len >> q;
  string arr = "";
  cin >> arr;
  unsigned long long countofdots = counting(arr);
  unsigned long long query;
  char replace;
  for (unsigned long long i = 0; i < q; i++) {
    int initial1, final1, initial2, final2;
    initial1 = final1 = initial2 = final2 = 0;
    cin >> query >> replace;
    if (arr[query - 1] == '.' && arr[query - 2] == '.') initial1 = 1;
    if (arr[query - 1] == '.' && arr[query] == '.') initial2 = 1;
    arr[query - 1] = replace;
    if (arr[query - 1] == '.' && arr[query - 2] == '.') final1 = 1;
    if (arr[query - 1] == '.' && arr[query] == '.') final2 = 1;
    if (initial1 && !final1) --countofdots;
    if (initial2 && !final2) --countofdots;
    if (!initial1 && final1) ++countofdots;
    if (!initial2 && final2) ++countofdots;
    cout << countofdots << endl;
  }
  return 0;
}
