x = input() l = x.count("^*") r = x.count("*^") print(str(l) + " " + str(r))