#include <bits/stdc++.h>
using namespace std;
void File() {
  freopen("output.txt", "w", stdout);
  freopen("input.txt", "r", stdin);
}
int countDivisors(long long n) {
  int cnt = 0;
  for (long long i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        cnt++;
      else
        cnt += 2;
    }
  }
  return cnt;
}
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
int const N = 3e5 + 9, MOD = 1e9 + 7, oo = 1e9 + 7;
int vis[N];
int lon[N];
int par[N];
vector<vector<int>> vv(N);
vector<int> BFS(int s, vector<vector<int>>& adjList) {
  vector<int> len(((int)(adjList).size()), oo);
  queue<int> q;
  q.push(s), len[s] = 0, par[s] = -1;
  int cur;
  while (!q.empty()) {
    int cur = q.front();
    q.pop();
    int n = adjList[cur].size();
    for (int i = 0; i < int(n); i++)
      if (len[adjList[cur][i]] == oo)
        q.push(adjList[cur][i]), len[adjList[cur][i]] = len[cur] + 1,
                                 par[adjList[cur][i]] = cur;
  }
  return len;
}
char arr[N];
int s;
string str;
int m = 0;
int main() {
  int k, q;
  cin >> k >> q;
  str.push_back('e');
  scanf("%s", arr);
  int n = strlen(arr);
  for (int i = 0; i < int(n); i++) str.push_back(arr[i]);
  for (int i = str.size() - 1; i >= 0; i--) {
    if (str[i] == '.')
      s++;
    else {
      if (s == 0) continue;
      m += s - 1;
      s = 0;
    }
  }
  while (q--) {
    char c;
    int x;
    cin >> x >> c;
    if (str[x - 1] == '.' && str[x + 1] == '.') {
      if (c == '.' && str[x] != '.') {
        m += 2;
      } else if (c != '.' && str[x] == '.') {
        m -= 2;
      }
    } else if (str[x - 1] == '.' || str[x + 1] == '.') {
      if (c == '.' && str[x] != '.') {
        m += 1;
      } else if (c != '.' && str[x] == '.') {
        m -= 1;
      }
    }
    str[x] = c;
    cout << m << '\n';
  }
  return 0;
}
