/f{3 1 roll dup =only( )dup 1 5 index put print 3 index 44 lt{3 index 42 eq{mul}{add}ifelse}{sub}ifelse}def 300{0 0 0(%stdin)(r)file 90 string readline{{dup 48 lt{f 0}{48 sub exch 10 mul add}ifelse}forall 61 f =}if}repeat
Note that non-ascii characters in the above source code will be escaped (such as \x9f).