import java.util.*; public class Main { public static void main(String[] args){ Scanner cs = new Scanner(System.in); String a = cs.next(); int cnt = 0; int left = 0; int right = 0; for(int i = 0;i < a.length();i++){ if(a.charAt(i) == '*'){ if(a.charAt(i-1) == '^'){ left++; }else if(a.charAt(i-1) == '('){ right++; } } } System.out.println(left+" "+right); } }