#include<stdio.h>
int main() {
    char str[1002];
    while (fgets(str, 1002, stdin)) {
        int i = 0, j = 0, flag = 0, sum = 0;
        while (str[i]) {
            if (str[i] == '\"')flag = 1;
            j = i + 1;
            while (str[j] != (flag ? '\"' : ' ') && str[j] != '\n')j++;
            for (i = str[i] == '\"' ? i + 1 : i; i < j; i++);
            if (flag)j++;
            flag = 0;
            sum++;
            //printf("%c", str[i]);
        //printf("\n");
            i = j + 1;
        }
        i = 0;
        printf("%d\n", sum);
        while (str[i]) {
            if (str[i] == '\"')flag = 1;
            j = i + 1;
            while (str[j] != (flag ? '\"' : ' ') && str[j] != '\n')j++;
            for (i = str[i] == '\"' ? i + 1 : i; i < j; i++)
                printf("%c", str[i]);
            printf("\n");
            if (flag)j++;
            flag = 0;
            i = j + 1;
        }
    }
}