/*
 * NameAnalyzerExtended.java
 * Computer Science S-111
 *
 * This is an extended version of the NameAnalyzer program.
 * It is able to handle an arbitrary name of the form "first last".
 */

import java.util.*;

public class NameAnalyzerExtended {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);
        String name = console.nextLine();
        System.out.println("full name = " + name);

        // Get and print the length.
        int length = name.length();
        System.out.println("length = " + length);

        // Extract and print the first name.
        // We make use of the assumption that there is always exactly one
        // space between the first and last names.
        int spaceIndex = name.indexOf(' ');
        String first = name.substring(0, spaceIndex);
        System.out.println("first name = " + first);
        
        // Extract and print the last name.
        String last = name.substring(spaceIndex + 1);
        System.out.println("last name = " + last);
    }
}
