#include <bits/stdc++.h>
using namespace std;
void llscan(long long &num) {
  bool n = false;
  num = 0;
  register int c = getchar();
  if (c == '-') {
    n = true;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) num = num * 10 + c - 48;
  if (n) num *= -1;
}
void iscan(int &num) {
  bool n = false;
  num = 0;
  register int c = getchar();
  if (c == '-') {
    n = true;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) num = num * 10 + c - 48;
  if (n) num *= -1;
}
void lscan(long &num) {
  bool n = false;
  num = 0;
  register int c = getchar();
  if (c == '-') {
    n = true;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) num = num * 10 + c - 48;
  if (n) num *= -1;
}
void cstring(string &s) {
  char c = getchar();
  for (; toascii(c) > 32 && toascii(c) < 127; c = getchar()) s += c;
}
void cppstring(string &s) {
  char c = getchar();
  for (; toascii(c) > 31 && toascii(c) < 127; c = getchar()) s += c;
}
int main() {
  char ch;
  long length, m, index, ans = 0;
  string s;
  lscan(length);
  lscan(m);
  cstring(s);
  for (long i = 1; i < length; i++) {
    if (s[i] == '.') ans += (s[i] == s[i - 1]);
  }
  for (typeof(m) i = 0; i < m; i++) {
    cin >> index >> ch;
    if (ch != '.') {
      if (s[index - 1] == '.') {
        if (index > 1 && index < length) {
          if (s[index - 2] != '.') {
            if (s[index] == '.') ans--;
          } else {
            if (s[index] != '.')
              ans--;
            else
              ans -= 2;
          }
        } else {
          if (index == 1) {
            if (s[index] == '.') ans--;
          } else {
            if (s[index - 2] == '.') ans--;
          }
        }
      }
      s[index - 1] = ch;
    } else {
      if (s[index - 1] != '.') {
        if (index > 1 && index < length) {
          if (s[index - 2] != '.') {
            if (s[index] == '.') ans++;
          } else {
            if (s[index] == '.')
              ans += 2;
            else
              ans++;
          }
        } else {
          if (index == 1) {
            if (s[index] == '.') ans++;
          } else {
            if (s[index - 2] == '.') ans++;
          }
        }
      }
      s[index - 1] = '.';
    }
    cout << ans << '\n';
  }
  return 0;
}
