#!/usr/bin/python3 #!coding: utf-8 i=input() print(str(i.count("(^^*)"))+" "+str(i.count("(*^^)")))