sub f{my$b=pop;8*$*(local$=$+$b)>$'?0:f($-$b)+f($b)+$%2}print f<>=~//