import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String S = scan.next(); scan.close(); if(S.length() == 1) { System.out.println(0 + " " + 0); System.exit(0); } int cnt1 = 0; int cnt2 = 0; for(int i = 0; i < S.length() / 5; i++) { String k = S.substring(5 * i, 5 *(i + 1)); if(k.equals("(^^*)")) { cnt1 ++; }else if(k.equals("(*^^)")) { cnt2 ++; } } System.out.println(cnt1 + " " + cnt2); } }