import java.util.*; public class Main { public static void main(String args[] ) throws Exception { Scanner sc = new Scanner(System.in); String input = sc.next(); int right = 0, left = 0; for (int i = 0 ; i < input.length() ; i++) { if ( (i = input.indexOf("(^^*)", i)) != -1){ left++; } else { break; } } for (int i = 0 ; i < input.length() ; i++) { if ( (i = input.indexOf("(*^^)", i)) != -1){ right++; } else { break; } } System.out.println(left + " " + right); } }