import strutils const face_L = "(^^*)" let S = stdin.readLine L = S.count(face_L) R = S.len div face_L.len - L echo L, " ", R