import java.util.Scanner;
import java.lang.String;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
findlastword(s);
}
public static void findlastword(String s){
String[] str = s.split(" ");
int length = str.length;
char c[]=str[length-1].toCharArray(); /// 方法1,转换成字符串,计算个数
System.out.println(c.length);
System.out.println(str[length-1].length());// 方法2 采用String的length方法
}
}