#include <bits/stdc++.h>
using namespace std;
int Int() {
  int x;
  scanf("%d", &x);
  return x;
}
long long Long() {
  long long x;
  scanf("%lld", &x);
  return x;
}
void err(istream_iterator<string> it) { cout << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << ' ';
  err(++it, args...);
}
const int N = (int)3e5 + 5;
const int maxN = (int)1e6 + 6;
const long long Mod = (long long)1e9 + 7;
const int inf = (int)2e9;
const long long Inf = (long long)1e18;
const int mod = (int)1e9 + 7;
int add(int a, int b) {
  a += b;
  return a >= b ? a - mod : a;
}
int sub(int a, int b) {
  a -= b;
  return a < 0 ? a + mod : a;
}
int mul(int a, int b) { return (long long)a * b % mod; }
char s[N];
bool isSame(char a, char b) {
  return ((a >= 'a' and a <= 'z' and b >= 'a' and b <= 'z') or
          (a == '.' and b == '.'));
}
int main() {
  int test = 1, tc = 0;
  while (test--) {
    int n = Int(), q = Int(), res = 0, seg = 0;
    scanf("%s", s + 1);
    s[0] = '#', s[n + 1] = '#';
    int i = 1;
    while (i <= n) {
      if (s[i] == '.') {
        seg++;
        while (i <= n and s[i] == '.') {
          ++res;
          ++i;
        }
      } else
        ++i;
    }
    while (q--) {
      int p = Int();
      getchar();
      char c = getchar();
      getchar();
      if (!isSame(c, s[p])) {
        if (c == '.') {
          if (s[p - 1] == '.' and s[p + 1] == '.') {
            seg--;
            res++;
          } else if (s[p - 1] == '.' or s[p + 1] == '.')
            ++res;
          else {
            ++seg;
            ++res;
          }
        } else {
          if (s[p - 1] == '.' and s[p + 1] == '.') {
            ++seg;
            res--;
          } else if (s[p - 1] != '.' and s[p + 1] != '.')
            --seg, --res;
          else
            --res;
        }
      }
      s[p] = c;
      printf("%d\n", res - seg);
    }
  }
  return 0;
}
