import java.util.Scanner;
public class F {
public static void main(String[] args) {
//空格数
int space = 0;
//换行数
int line = 0;
Scanner s = new Scanner(System.in);
String str = "-1";
while (!"t".equalsIgnoreCase(str)) {
str = s.nextLine();
line++;
char[] ch = str.toCharArray();
for (int i = 0; i < ch.length; i++) {
if (Character.isSpaceChar(ch[i])) {
space++;
}
}
}
line=line-2;
System.out.println(space+" "+line);
}
}
控制台输出结果: