import java.util.Scanner; public class Main { public static void main(String[] p) { Scanner q = new Scanner(System.in); String str = q.next(); int a = 0; for (int i = 0; i < str.length();) { if (i + 4 < str.length() && "hamu".equals(str.substring(i, i + 4))) { a <<= 1; i += 4; } else { a <<= 0; i += 3; } } System.out.println(a); } }