S=raw_input() a=0 b=0 a+=S.count('(^^*)') b+=S.count('(*^^)') print a, b