import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final String str = sc.next(); int left_count = 0, right_count = 0; final Matcher left_match = Pattern.compile("(\\^\\^\\*)").matcher(str); final Matcher right_match = Pattern.compile("(\\*\\^\\^)").matcher(str); while(left_match.find()){ left_count++; } while(right_match.find()){ right_count++; } System.out.printf("%d %d\n", left_count, right_count); } }