func_code_string: #include <bits/stdc++.h>   using namespace std;   #pragma GCC optimize( O3 )   #pragma GCC optimize( Ofast )   #pragma GCC optimize( unroll-loops )   template <typename Arg1>   void __f(const char* name, Arg1&& arg1) {     cerr << name <<   :   << arg1 <<   n ;   }   template <typename Arg1, typename... Args>   void __f(const char* na, Arg1&& arg1, Args&&... args) {     const char* c = strchr(na + 1,  , );     cerr.write(na, c - na) <<   :   << arg1 <<   ,  ;     __f(c + 1, args...);   }   const double pi = acos(-1.0);   const double eps = 1e-8;   const int inf = 1e9;   const long long INF = 1e18;   const int mod = 1e9 + 7;   const int N = 3e5 + 5;   void solve() {     int len, q;     cin >> len >> q;     string s;     cin >> s;     s =  #  + s;     int ans = 0;     for (int i = 1; i <= len;) {       if (s[i] ==  . ) {         int j = i;         while (j <= len && s[j] ==  . ) j++;         ans += (j - i - 1);         i = j;       } else {         i++;       }     }     while (q--) {       int pos;       string ch;       cin >> pos >> ch;       if (s[pos] !=  .  && ch[0] ==  . ) {         if (pos - 1 >= 1 && s[pos - 1] ==  . ) ans++;         if (pos + 1 <= len && s[pos + 1] ==  . ) ans++;         s[pos] =  . ;       } else if (s[pos] ==  .  && ch[0] !=  . ) {         if (pos - 1 >= 1 && s[pos - 1] ==  . ) ans--;         if (pos + 1 <= len && s[pos + 1] ==  . ) ans--;         s[pos] = ch[0];       }       cout << ans <<   n ;     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     int t = 1;     for (int tc = 1; tc <= t; tc++) solve();     return 0;   }   