#include <stdio.h>

int main() {
    int ch,r;
    r = 0;
    printf("Print something:\n");
    while((ch = getchar()) != '#'){
        if(ch == '!'){r++;putchar('!');putchar('!');}  
        else if(ch == '.'){r++;putchar('!');}
        else putchar(ch);
    }
    printf("\nr: %d",r);
    return 0;
}
