#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.1415926535897932384626;
long long MOD = 1000000007;
const long double EPS = 1e-9;
const int N = 3e5 + 7;
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline unsigned int setBits(unsigned int v) {
  unsigned int c;
  for (c = 0; v; ++c) v &= (v - 1);
  return c;
}
inline bool isPowerOfTwo(unsigned int v) { return (v && !(v & (v - 1))); }
bool isPalin(const string& s) {
  int i, j;
  for (i = 0, j = s.length() - 1; i <= j; ++i, --j)
    if (s[i] != s[j]) return false;
  return true;
}
long long power(long long base, unsigned long long exp, long long mod = MOD) {
  long long res = 1;
  base %= mod;
  while (exp) {
    if (exp & 1) res = (res * base) % mod;
    exp >>= 1;
    base = (base * base) % mod;
  }
  return res;
}
long long modInv(long long a, long long mod = MOD) {
  if (mod == 1) return 0;
  long long x = 1, y = 0, m = mod;
  while (a > 1) {
    long long q = a / m, t = m;
    m = a % m;
    a = t;
    t = y;
    y = x - q * y;
    x = t;
  }
  if (x < 0) x += mod;
  return x;
}
inline unsigned int iabs(int x) {
  unsigned int y = x;
  return (y > 0) ? y : -y;
}
inline long long add(long long a, long long b, long long mod = MOD) {
  long long res = (a % mod + b % mod) % mod;
  return res;
}
inline long long sub(long long a, long long b, long long mod = MOD) {
  long long res = (a % mod - b % mod + mod) % mod;
  return res;
}
inline long long mult(long long a, long long b, long long mod = MOD) {
  long long res = (a % mod * b % mod) % mod;
  return res;
}
inline long long div(long long a, long long b, long long mod = MOD) {
  long long res = (a % mod * modInv(b, mod)) % mod;
  return res;
}
void openf() {}
string s;
char t = '.';
int n, m;
int num, group;
bool ok[300007];
int main() {
  cin >> n >> m >> s;
  for (int i = 0; i < n; ++i) {
    if (s[i] == t) {
      num++;
      if (i == 0 || s[i - 1] != t) group++;
      ok[i + 1] = 1;
    }
  }
  while (m--) {
    int d;
    char c;
    scanf("%d %c", &d, &c);
    bool a = ok[d], b = c == t;
    if (a != b) {
      if (a) {
        num--;
      } else {
        num++;
      }
      if (ok[d - 1] && ok[d + 1] && !b) {
        group++;
      }
      if (ok[d - 1] && ok[d + 1] && b) {
        group--;
      }
      if (!ok[d - 1] && !ok[d + 1] && !b) {
        group--;
      }
      if (!ok[d - 1] && !ok[d + 1] && b) {
        group++;
      }
    }
    ok[d] = b;
    printf("%d\n", num - group);
  }
}
