S = input() print(S.count("^*"), S.count("*^"))