#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<vector>
#include<queue>
#include<cmath>
#include<memory.h>
#define ll long long
using namespace std;
ll dp[22],k[22],digit[202];
ll detal(ll x)
{
ll i,ans=0,now;
for(i=18;i>=0;i--)
if(digit[i]<=x)
break;
while(i>=0)
{
now=x/digit[i];
x%=digit[i];
ans+=k[now-1]*digit[i]+now*(x+1);
ans+=now*dp[i];
i--;
}
return ans;
}
int main()
{
ll n,m;
dp[0]=0;
digit[0]=1;
k[0]=0;
for(int i=1;i<19;i++)
{
k[i]=k[i-1]+i;
digit[i]=digit[i-1]*10;
}
dp[1]=k[9];
for(int i=2;i<=10;i++)
dp[i]=dp[i-1]*10+k[9]*digit[i-1];
while(scanf("%lld %lld",&n,&m),n+m)
{
printf("%lld\n",detal(m)-detal(n-1));
}
return 0;
}