import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines S = read() x = S.count(b'^^*') y = S.count(b'*^^') print(x,y)