exec"s=/x:/y:/z:x(z)(y(z));k=/x:/y:x;i=/x:x;f=/n:n+1;r=/c:c=='`'and r(z())(r(z()))or eval(c)".replace("/","lambda ") while 1:z=iter(raw_input()).next;print r(z())(f)(0)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).