// Gaus, Okruzno 2007
#include <cstdio>
#include <vector>
using namespace std;

vector<int> cifra;

long count(long n, bool paran, bool manje){
	if (n==-1){
		if (paran) return 1;
		else return 0;
	}
	else{
		long ret=0;
		
		if (manje){
			ret += 5*count(n-1,paran,true) + 5*count(n-1,!paran,true);
		}
		else{
			if (cifra[n]%2==0) ret += count(n-1, paran, false);
			else ret += count(n-1,!paran,false);
			
			if (cifra[n]>0){				
				int p=1 + (cifra[n]-1)/2;
				int np=(1 + cifra[n]-1)/2;				
			
				ret += p * count(n-1,paran,true);
				ret += np * count(n-1,!paran,true);
			}						
		}
		
		return ret;
	}
}


int main(){
	long A,B;
	
	FILE *f;
	f=fopen("gaus.10.in","r");
	fscanf(f,"%ld %ld",&A,&B);
	fclose(f);	

	long res=0;
	
	while (B>0){
		cifra.push_back(B%10);
		B/=10;
	}
	res+=count(cifra.size()-1,true,false);
	
	cifra.clear();
	A--;
	while (A>0){
		cifra.push_back(A%10);
		A/=10;
	}
	res-=count(cifra.size()-1,true,false);

	  
	f=fopen("gaus.10.out","w");
	fprintf(f,"%ld\n",res);
	fclose(f);
	
	return 0;
}

