import java.util.*;
public class Main {
    public static void main(String[] arg) {
        Scanner s = new Scanner(System.in);
        while (s.hasNext()) {
            String input=s.nextLine();
            StringBuilder sb=new StringBuilder();
            int count = 1;
            for (int i = 0; i < input.length(); i++) {
                if(input.charAt(i)==' '||input.charAt(i)=='\"'){
                    if(input.charAt(i)==' '){
                        sb.append("\r\n");
                        count++;
                    }else{
                        for(int j=i+1;j<input.length();j++){
                            if(input.charAt(j)=='\"'){
                                i=j;
                                break;
                            }
                            sb.append(input.charAt(j));
                        }
                    }
                }else{
                    sb.append(input.charAt(i));
                }
            }
            System.out.println(count);
            System.out.print(sb.toString());
        }
    }
}