import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String[] split = in.nextLine().split("[a-z]+");
        int len = 0;
        for (String s : split) {
            if (s.isEmpty()) continue;
            if (s.length() > len) len = s.length();
        }
        for (String s : split) {
            if (s.isEmpty()) continue;
            if (s.length() == len) System.out.print(s);
        }
        System.out.printf(",%d", len);
        in.close();
    }
}