import java.util.*; import java.util.stream.Stream; public class No495 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); s = s.replace("(^^*)", "h"); s = s.replace("(*^^)", "m"); int hc = 0, mc = 0; for(int i = 0 ; i < s.length(); i++) { if(s.charAt(i) == 'h') { hc++; }else if(s.charAt(i) == 'm') { mc++; } } System.out.println(hc + " " +mc); } }