import java.util.Scanner;
/**
* HJ92 在字符串中找出连续最长的数字串 - 中等
*/
public class HJ092 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
String str = sc.nextLine();
String[] strs = str.split("[^0-9]+");
int max = 0;
for (String s : strs) {
if (s.length() > max) {
max = s.length();
}
}
StringBuffer sb = new StringBuffer();
for (String s : strs) {
if (s.length() == max) {
sb.append(s);
}
}
System.out.println(sb.append(",").append(max));
}
sc.close();
}
}