# coding: utf-8 # Here your code ! S=input() print(str(S.count('^*'))+" "+str(S.count('*^')))