func_code_string: #include <bits/stdc++.h>   using namespace std;   char s[300100];   int main() {     int n, m;     while (~scanf( %d %d n , &n, &m)) {       gets(s);       int len = strlen(s);       int ans = 0;       for (int i = 1; i < len; i++) {         if (s[i] ==  .  && s[i - 1] ==  . ) ans++;       }       char op[3];       int t;       while (m--) {         scanf( %d %s , &t, op);         t--;         if (op[0] ==  . ) {           if (s[t] ==  . ) {             printf( %d n , ans);             continue;           }           if ((t - 1 >= 0 && s[t - 1] ==  . ) && (t + 1 < len && s[t + 1] ==  . ))             ans += 2;           else if ((t - 1 >= 0 && s[t - 1] ==  . ) ||                    (t + 1 < len && s[t + 1] ==  . ))             ans++;         } else if (s[t] ==  . ) {           if ((t - 1 >= 0 && s[t - 1] ==  . ) && (t + 1 < len && s[t + 1] ==  . ))             ans -= 2;           else if ((t - 1 >= 0 && s[t - 1] ==  . ) ||                    (t + 1 < len && s[t + 1] ==  . ))             ans -= 1;         }         s[t] = op[0];         printf( %d n , ans);       }     }     return 0;   }   