Skip to main content
2 of 4
golf some more
etene
  • 448
  • 2
  • 7

Python 3, 114 110 bytes

Saved 4 extra bytes thanks to @ElPedro

i=0;exec(";".join("i+=1 i-=1 i*=2 i/=2 print(i) exit()".split()["idmhPe".find(h[0])]for h in input().split()))

Try it online!

Maps the first character of every input word to a piece of Python code. These are then concatenated and execed.

Pretty straightforward approach, that could probably be golfed a bit more. The difficulty mostly resides in finding the shortest form out of many possible ones...

etene
  • 448
  • 2
  • 7