def main(): S = str(input()) l = S.count('(^^*)') r = S.count('(*^^)') print('{} {}'.format(l, r)) main()