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