import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * 在一串字符串中寻找最长的数字子串
 * @author Green.Gee
 * @date 2022/12/22 19:16
 * @email green.gee.lu@gmail.com
 */
public class FindMaxNumInStr {

    /**
     * 输入一个字符串,返回其最长的数字子串,以及其长度。
     * 若有多个最长的数字子串,则将它们全部输出(按原字符串的相对位置)
     * @param args
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextLine()) {
            String str = in.nextLine();

            int i = 0;
            int len = str.length();
            List<String> result = new ArrayList<>();
            String temp = "";
            String max = "";
            while(i < len){
                char ch = str.charAt(i);
                if(Character.isDigit(ch)){
                    temp += ch;
                }else{
                    if(!"".equals(temp) && temp.length() >= max.length()){
                        max = temp;
                        result.add(temp);
                    }
                    temp = "";
                }
                i++;
            }
            if(!"".equals(temp) && temp.length() >= max.length()){
                result.add(temp);
                max = temp;
            }
            final int maxLen = max.length();
            result.stream()
                    .filter(item -> item.length() == maxLen)
                    .forEach(System.out::print);
            System.out.println(","+maxLen);

        }
    }


}