#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, q;
    string s;
    cin >> n >> q >> s;
    auto pairAt = [&](int p) {
        return p >= 0 && p + 1 < n && s[p] == '.' && s[p + 1] == '.';
    };
    int ans = 0;
    for (int i = 0; i + 1 < n; i++)
        ans += pairAt(i);
    while (q--) {
        int p;
        char c;
        cin >> p >> c;
        --p;
        ans -= pairAt(p - 1) + pairAt(p);
        s[p] = c;
        ans += pairAt(p - 1) + pairAt(p);
        cout << ans << '\n';
    }
}
