#include <stdio.h>

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