import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); String S = sc.next(); String l = "(^^*)"; String r = "(*^^)"; int cntL = 0, cntR = 0; for (int i = 0; i + 5 < S.length(); i += 5) { if (S.substring(i, i + 5).equals(l)) { ++cntL; } else if (S.substring(i, i + 5).equals(r)) { ++cntR; } } System.out.println(cntL + " " + cntR); } }