import java.util.Scanner; public class Main { public static int f(StringBuilder str, int len) { int cnt = 0, ans = 0; boolean firstDot = true; int i=0,j=0; while (j < len) { if(str.charAt(i) == '.') for(j = i+1;j < len; j++) if(str.charAt(j) != '.') break; if(j == len && str.charAt(j-1)=='.')
                cnt += len - 1 - i; else cnt += j-1-i;
            i = j+1;
        } return cnt;
    } public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        StringBuilder str; int n,m,x,i; char c = '.'; while (scan.hasNext()) {
            n = scan.nextInt();
            m = scan.nextInt();
            System.out.println("n: " +n + "m: " + m);
            str = new StringBuilder(scan.next());
            System.out.println(str); for(i = 0; i < n; i++) {
                x = scan.nextInt();
                c = scan.next().charAt(0);
                str.replace(x-1,x,c+"");
                System.out.println( str + " " +f(str,n));
            }
        }
    }
}