($n,$m)=glob<>;$d[$_]=$_<$n||$d[$_-$n]+$d[$_-1]for 0..$m;print$d[$m]