use bigint;sub f{my($r,$l,$d,$a)=@_;${"@_"}//=$r<3?$l<$d&$d<=$r:$a+!map$a+=f(($r-$_)/5,($l-$_+5)/5-1,$d-$_),-2..2}print f<>