# yukicoder No.423 ハムスター語初級(数詞) n = input() n_bi = "" while n != "": if len(n) == 3: n_bi += "0" break elif n[3] == "u": # 前から4文字目だけ見ればhamかhamuか分かる n_bi += "1" n = n[4:] else: n_bi += "0" n = n[3:] print(int(n_bi,2))