import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
private static Scanner cin;
public static void main(String args[]) throws Exception {
cin = new Scanner(System.in);
String word = cin.nextLine();
String sentence = cin.nextLine();
String wordExp = "[a-zA-Z]+";
Pattern pattern = Pattern.compile(wordExp);
Matcher matcher = pattern.matcher(sentence);
int count = 0;
int index = -1;
while(matcher.find()) {
if(matcher.group().equalsIgnoreCase(word)) {
if (-1 == index) {
index = matcher.start();
}
count++;
}
}
if(count >0)
System.out.println(String.format("%d %d", count,index));
else
System.out.println(index);
}
}