S = str(input()) r = S.count('*^^') l = S.count('^^*') print(l,r)