# -*- coding: utf-8 -*- s = input() print(s.count("(^^*)"),s.count("(*^^)"))