s = raw_input() l = 0 r = 0 for i in range(1,len(s),5): if s[i] == '^': l += 1 else: r += 1 print l,r