https://ac.nowcoder.com/acm/problem/16585
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String search = sc.nextLine();
String text = sc.nextLine();
String[] splitArray = text.split(" ");
int count = 0;
int index = 0;
for(int i = 0;i<splitArray.length;i++){
if(search.equalsIgnoreCase(splitArray[i])){
count++;
}
if(count == 0) {
index = index + splitArray[i].length() + 1;
}
}
if(count == 0) System.out.println(-1);
else {
System.out.println(count + " " + index);
}
}
}