# -*- coding: utf-8 -*-


kaos = input()
print(kaos.count('^*'), kaos.count('*^'))