func_code_string: #include <bits/stdc++.h>   #pragma comment(linker,  /STACK:102400000,102400000 )   using namespace std;   const int N = 3e5 + 100;   const double PI = acos(-1.0);   void fre() {     freopen( /Users/luras/Desktop/in.txt ,  r , stdin);     freopen( /Users/luras/Desktop/out.txt ,  w , stdout);   }   int n, m, i, j, ans, p;   char s[N], ch;   int main() {     while (~scanf( %d%d , &n, &m)) {       scanf( %s , s + 1);       ans = 0;       for (i = 2; i <= n; i++) {         if (s[i] ==  .  && s[i - 1] ==  . ) ans++;       }       for (i = 1; i <= m; i++) {         scanf( %d %c , &p, &ch);         if ((s[p] ==  .  && ch ==  . ) || (s[p] !=  .  && ch !=  . )) {           printf( %d n , ans);           continue;         }         if (s[p] ==  . ) {           if (p == 1) {             if (s[p + 1] ==  . ) {               ans--;             }           } else {             if (s[p + 1] ==  . ) ans--;             if (s[p - 1] ==  . ) ans--;           }         } else {           if (p == 1) {             if (s[p + 1] ==  . ) ans++;           } else {             if (s[p + 1] ==  . ) ans++;             if (s[p - 1] ==  . ) ans++;           }         }         s[p] = ch;         printf( %d n , ans);       }     }     return 0;   }   