#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 2e6 + 4;
int solve(int val) {
  long long here = 0;
  while (val > 1) {
    here += (val / 2);
    val = (val + 1) / 2;
  }
  return here;
}
int main() {
  int n, q;
  scanf("%d", &n);
  scanf("%d", &q);
  string s;
  cin >> s;
  vector<int> l(n, -1), r(n, -1);
  int cur_l = -1, cnt = 0;
  set<pair<int, int>> st;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != '.') {
      if (cur_l != -1) {
        st.insert(make_pair(cur_l, cur_l + cnt - 1));
        ans += solve(cnt);
        cur_l = -1, cnt = 0;
      }
    } else {
      if (cur_l == -1) cur_l = i;
      cnt++;
      l[cur_l] = i;
      r[i] = cur_l;
      if (cnt > 1) r[i - 1] = -1;
    }
  }
  while (q--) {
    int ind;
    char ch;
    cin >> ind >> ch;
  }
  return 0;
}
