#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const int MAX = 100000 + 5;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << " ";
  err(++it, args...);
}
bool ok[300009];
void solve(void) {
  string s;
  int n, m;
  cin >> n >> m >> s;
  int tot = 0, seg = 0;
  char dot = '.';
  for (int i = 0; i < n; ++i) {
    if (s[i] == dot) {
      ++tot;
      if (!i || s[i - 1] != dot) ++seg;
      ok[i + 1] = 1;
    }
  }
  while (m--) {
    int pos;
    char c;
    cin >> pos >> c;
    bool f = ok[pos], check = c == dot;
    if (f != check) {
      if (f)
        --tot;
      else
        ++tot;
      if (!ok[pos - 1] && !ok[pos + 1] && !check) --seg;
      if (ok[pos + 1] && ok[pos - 1] && check) --seg;
      if (ok[pos - 1] && ok[pos + 1] && !check) ++seg;
      if (!ok[pos - 1] && !ok[pos + 1] && check) ++seg;
    }
    ok[pos] = check;
    cout << tot - seg << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
