import java.util.*; public class Main{ public static void main(String[] args){ String line = new Scanner(System.in).next(); int count=0,right=0,left=0; while(true){ if(line.indexOf("(^^*)", count) == count){ count += 5; left++; } else if(line.indexOf("(*^^)", count) == count){ count += 5; right++; } else break; } System.out.println(left + " " + right); } }