import sys def solve(): s = input() lc = s.count('(^^*)') rc = s.count('(*^^)') print(lc, rc) def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None if __name__ == '__main__': solve()