s = input() left = 0 right = 0 for i in range(len(s)//5): if s[5*i+1] == '^': left += 1 else: right += 1 print ('{} {}'.format(left, right))