Go: package main

import (
	"bufio"
	"os"
		"strings"
	"strconv"
			"fmt"
	)

var scanner = bufio.NewScanner(os.Stdin)
const (
	MAX = 1000000
)
func main() {
	a := make([]int, MAX+1)
	a[1] = 1
	for i := 2; i <= MAX; i *= 2 {
		a[i]++
	}
	for i := 1; i <= MAX; i++ {
		if a[i] != 0 {
			for j := i*3; j <= MAX; j *= 3 {
				if a[j] == 0 {
					a[j]++
				}
			}
		}
	}
	for i := 1; i <= MAX; i++ {
		if a[i] != 0 {
			for j := i*5; j <= MAX; j *= 3 {
				if a[j] == 0 {
					a[j]++
				}
			}
		}
	}
	for scanner.Scan() {
		buf := strings.Split(scanner.Text(), " ")
		m, _ := strconv.Atoi(buf[0])
		if m == 0 {
			break
		}
		n, _ := strconv.Atoi(buf[1])
		cnt := 0
		for i := m; i <= n; i++ {
			if a[i] != 0 {
				cnt++
			}
		}
		fmt.Println(cnt)
	}
}

C++: #include<bits/stdc++.h>

using namespace std;

int main(){

  int m,n;

  while(cin>>m>>n, m || n){
	
	int count = 0;
	
	for(int i=m;i<=n;++i){

	  int result = i;
	  
	  while(1){

		if(result%2!=0)
		  break;
		else{
		  result = result/2;
		  if(result==0)
			break;
		}
		
	  }
	  
	  while(1){
		
		if(result%3!=0)
		  break;
		else{
		  result = result/3;
		 if(result==0)
			break;
		}
	  }

	  while(1){

		if(result%5!=0)
		  break;
		else{
		  result = result/5;
		 if(result==0)
			break;
		}
	  }

	  if(result == 1)
		count++;
	  
	}

	cout<<count<<endl;
	
  }
  
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()

#define PI acos(-1.0)
#define INF 1000000007

typedef long long ll; 
typedef pair<ll, ll> PL;

ll n, m;

int main(){
	while (cin >> m){
		if (m == 0)break;
		cin >> n;
		ll c = 0, x = pow(60.0, 10.0);
		FOR(i, m, n + 1){
			if (x % i == 0){
				c++;
			}
		}
		cout << c << endl;
	}
}

C++: #include<iostream>
using namespace std;

int main()
{
    int m, n;

    while( cin >> m )
    {
        if( m == 0 )
            break;
        
        cin >> n;
        
        int cnt = 0;

        for( int i = m; i <= n; i++ )
        {
            int j = i;
            while( j % 2 == 0 )
                j /= 2;
            while( j % 3 == 0 )
                j /= 3;
            while( j % 5 == 0 )
                j /= 5;
            if( j == 1 )
                cnt++;
        }
        cout << cnt << endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
/*
bool sw[1000001];
int i;
 
void sws(int k){
        if(k==1){
                sw[i]=true;
                return;
        }
        if(k%2==0) sws(k/2);
        else if(k%3==0) sws(k/3);
        else if(k%5==0) sws(k/5);
        return;
}
*/
// korenisuru
int dp[1000001];
int f(int n){
        if(~dp[n]) return dp[n];
        int ans = 0;
        if(n%2==0) ans |= f(n/2);
        if(n%3==0) ans |= f(n/3);
        if(n%5==0) ans |= f(n/5);
        return dp[n] = ans;
}
 
int main() {
        int m,n;
        for(int i = 0 ; i <= 1000000 ; i++) dp[i] = -1;
        dp[1] = 1;
        for(int i = 1 ; i <= 1000000 ; i++) f(i);
        while(cin >> m && m){
                cin >> n;
                int ans = 0;
                for(int i = m ; i <= n ; i++) ans += dp[i];
                cout << ans << endl;
        }
        return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;

int x[2000000];
long long p;
int a, b, sum;

int main() {
	for (int i = 0; i < 20; i++) {
		for (int j = 0; j < 13; j++) {
			for (int k = 0; k < 9; k++) {
				p = (long long)pow(2, i)*(long long)pow(3, j)*(long long)pow(5, k);
				if (p < 2000000) {
					x[p] = 1;
				}
			}
		}
	}
	while (true) {
		sum = 0;
		cin >> a;
		if (a == 0) { break; }
		cin >> b;
		for (int i = a; i <= b; i++){
			sum += x[i];
		}
		cout << sum << endl;
	}
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second

static const double PI=6*asin(0.5);
typedef pair<double,double> P;
typedef complex<double> CP;
typedef long long ll;

bool a[1000010];
int b[1000010]={0};

int main(){
	rep(i,1000010){
		a[i]=false;
	}
	a[1]=true;
	for(int i=1;i<1000010;i++){
		if(a[i]){
			a[2*i]=true;
			a[3*i]=true;
			a[5*i]=true;
		}
	}
	rep(i,1000010){
		if(i==0) continue;
		b[i]=b[i-1];
		if(a[i]) b[i]++;
	}
	int m,n;
	while(cin>>m,m){
		cin>>n;
		cout<<b[n]-b[m]+1<<endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

bool div(int a){
    
    if(a == 1){
        return true;
    }else if(a % 2 == 0){
        return div(a/2);
    }else if(a % 3 == 0){
        return div(a/3);
    }else if(a % 5 == 0){
        return div(a/5);
    }else{
        return false;
    }
    
}

int main(int argc, const char * argv[]) {

    
    
    while(true){
        int m;
        cin >> m;
        if(m==0){
            break;
        }
        
        int n;
        cin >> n;
        
        int count = 0;
        for(int i=m;i<=n;i++){
            if(div(i)){
                count++;
            }
        }
        
        cout << count << endl;
    }
    

    
    return 0;
}

C++: # define _CRT_SECURE_NO_WARNINGS 1
# define _USE_MATH_DEFINES
# include <iostream>
# include <numeric>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <forward_list>
# include <map>
# include <stack>
using namespace std;
# define INF ((int)(1<<25))
# define REP(i,n) for(int i=0;i<(int)n;i++)
# define FOR(i,n) REP(i,n)
# define TORAD 2.0*M_PI/360.0
# define INT(x) int x;cin>>x;
# define ALL(x) (x).begin(),(x).end()
# define RALL(x) (x).rbegin(),(x).rend()
# define DEBUG(x) cout<<#x<<" :"<<x<<endl;
# define EPS 1e-12
template<class T> void debug(T a) { for (auto i : a)cout << i << endl; }
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
int dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 };

int maxi = 1000000;
int main()
{
	vector<int> a;
	for (int i = 0;; i++)
	{
		int I = pow(2, i);
		if (I > maxi)break;
		for (int j = 0;; j++)
		{
			int J = pow(3, j);
			if (I*J>maxi)break;
			for (int k = 0;; k++)
			{
				int K = pow(5, k);
				a.push_back(I*J*K);
				if (I*J*K > maxi)break;
			}
		}
	}
	sort(ALL(a));
	int m, n;
	while (cin >> m >> n&&(m||n))
	{
		int ans = 0;
		for (auto it = lower_bound(ALL(a), m); *it <= n; it++)ans++;
		cout << ans << endl;
	}
}