import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static long MOD = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); final char[] chs = sc.next().toCharArray(); int lefts = 0, rights = 0; for(int begin = 0; begin < chs.length; begin++){ if(chs[begin] != '('){ continue; } { boolean find_left_star = false; int hat_count = 0; for(int next = begin + 1; next < chs.length; next++){ if(chs[next] == '^'){ if(find_left_star){ hat_count++; } }else if(chs[next] == '*'){ find_left_star = true; }else if(chs[next] == ')' && hat_count >= 2){ rights++; } } } { int hat_count = 0; boolean find_right_star = false; for(int next = begin + 1; next < chs.length; next++){ if(chs[next] == '^'){ hat_count++; }else if(chs[next] == '*'){ if(hat_count >= 2){ find_right_star = true; } }else if(chs[next] == ')' && find_right_star){ lefts++; } } } } System.out.println(lefts + " " + rights); } }