import java.util.*; public class test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.next(); int right = 0; int left = 0; String[] sp = str.split(""); for (int i = 0; i < sp.length; i++) { if (sp[i].equals("(") && sp[i+1].equals("^")) { left++; } if (sp[i].equals("(") && sp[i+1].equals("*")) { right++; } } System.out.println(left + " " + right); } }