Simple golfing interpreter
shell + sed + dc, 56 61 bytes

sed '1i0
s/.//2g;y&quot;idmhe&quot;+-*/q&quot;;i1
/[*/]/i1+
/P/crdn'|dc

Try it online!
Converts the program into a dc program, then evaluates it as dc code. This takes the input separated by newlines. Note that dc is stack-based and uses reverse polish notation, so 5 2- gives 3, and numbers are always rounded down.
The input is first piped to sed
1i0 on the first line of input, insert (prepend) a 0, this will be the accumulator
s/.//2g remove everything but the first character on each line
y&quot;idmhe&quot;+-*/q&quot; transliterate idmhe into +-*/q respectively, + - * / are the arithmetic commands and q quits the program
i1 on every line insert a 1 - this satisfies addition and subtraction
/[*/]/ on every line containing * or /, i1+ additionally insert 1+ because of the preceding 1, which dc will eventually evaluate into 2
/P/ on every line containing P, crdn change it into rdn, equivalent to reverse the top two elements, to rid the inserted 1, and duplicate and output as a number without newline (whilst popping it, hence the earlier duplicate) in dc
Now this is evaluated as a dc expression.