function Main(input) {
	input = input.split("\n");
	const n = parseInt(input[0]);

	var text = input[1].split("");
	var count = 0;

	for (i=0;i<n;i++) {

			if (text[i] =='#' && text[i+1] == '.') {
				count = count + 1;
				var x = 0;
				while (text[i+1+x] == '#' || i+1+x == n){
					x++;
				}
				var y = 0;
				while (text[i-y] == '.' || i-y == -1){
					y++;
				}
				if (x > y){
						count = count + y
						text[i] = '.'
				}
			}
	}

	console.log(count);
	console.log(text);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));