#include <bits/stdc++.h>
using namespace std;
int main() {
  int size, m;
  cin >> size >> m;
  string s;
  cin >> s;
  stack<char> st;
  int count = 0;
  for (int i = 0; i < size; i++) {
    if (s[i] == '.') {
      if (st.empty())
        st.push('.');
      else if (st.top() == '.')
        count++;
      else
        st.push('.');
    } else
      st.push(s[i]);
  }
  for (int i = 0; i < m; i++) {
    int cur, flag;
    char c;
    cin >> cur;
    cin >> c;
    if (c == '.')
      flag = 1;
    else
      flag = -1;
    if (s[cur - 1] == '.' && c == '.') {
    } else if (s[cur - 1] == '.' || c == '.') {
      if (cur > 1) {
        if (s[cur - 2] == '.') count = count + flag;
      }
      if (cur <= size) {
        if (s[cur] == '.') count = count + flag;
      }
    }
    cout << count << endl;
    s[cur - 1] = c;
  }
  return 0;
}
