sub a{my$x=pop;$a{$x}=($a{$x/5|0}//a($x/5|0))+($a{$x/3|0}//a($x/3|0))} $a{0}=1; print a<>+0