n = input() s_flg = 0 s = "" for i in n[::-1]: if s_flg == 0 and i == "u": s += "1" s_flg = 1 elif s_flg == 0 and i == "m": s += "0" s_flg = 1 elif s_flg == 1 and i == "h": s_flg = 0 print(int(s[::-1], 2))