s = input() l = "(^^*)" r = "(*^^)" l_cnt = s.count(l) r_cnt = s.count(r) print(l_cnt, r_cnt)