left = "(^^*)" right = "(*^^)" s = input() print(s.count(left), s.count(right))