s = input() t = s[1::5] l=t.count('^') r=t.count('*') print(f'{l} {r}')