#import<cstdio>
#define MAX 1000001
int p[MAX] = {};
void f(int n){if(n>MAX||p[n])return;p[n]=1;f(n*2);f(n*3);f(n*5);}int main(){int m,n,a,i;for(f(1);~scanf("%d%d",&m,&n);printf("%d\n",a))for(i=m,a=0;i<=n;++i)if(p[i])++a;}