#include<bits/stdc++.h>
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimization("unroll-loops")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC optimize("fast-math")
// #pragma GCC optimize("no-stack-protector")
// #define ll __int128
#define ll long long
// #define ll int
#define f(i,a,b) for(int i=a;i<b;i++)
#define mod 1000000007
// #define mod 1000000009 
#define mp make_pair
#define uniq(v) (v).erase(unique(all(v)),(v).end())
#define ff first
#define ss second
#define rf(i,a,b) for(int i=a;i>=b;i--)
#define sc(a) scanf("%lld",&a)
#define pf printf
#define sz(a) (int)(a.size())
#define psf push_front
#define ppf pop_front
#define ppb pop_back
#define pb push_back
#define pq priority_queue
#define all(s) s.begin(),s.end()
#define sp(a) setprecision(a)
#define rz resize
#define ld long double
#define inf (ll)1e18
#define ub upper_bound
#define lb lower_bound
#define bs binary_search
#define eb emplace_back
const double pi = acos(-1);
ll binpow(ll a, ll b){ll res=1;while(b!=0){if(b&1)res*=a;a*=a;b>>=1;}return res;}
// ll binpow(ll a, ll b, ll md){ll res=1;a%=mod;while(b!=0){if(b&1)res*=a,res%=md;a*=a,a%=md;b>>=1;}return res%md;}
 
using namespace std;

ll dp[11][101][101][2];

ll fn(int i, int tot, int other, int tight, string s)
{
    if(i>=sz(s))
    {
        if(other==tot && other>0 && tot>0)
            return 1;
        else
            return 0;
    }
    ll &ans=dp[i][tot][other][tight];
    if(ans==-1)
    {
        ans=0;
        int mx=(tight?(s[i]-'0'):9);
        f(j,0,mx+1)
            ans+=(fn(i+1,tot,other+j,tight&&(j==mx),s)+fn(i+1,tot+j,other,tight&&(j==mx),s));
    }
    return ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // freopen("gift1.in","r",stdin);
    // freopen("gift1.out","w",stdout);
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
    int z=1;
    // cin>>z;
    while(1)
    { 
        string a,b;
        cin>>a>>b;
        if(a=="0" && b=="0")
            break;
        memset(dp,-1,sizeof(dp));
        ll R=fn(0,0,0,1,b)/2;
        ll val=stoi(a)-1;
        a=to_string(val);
        memset(dp,-1,sizeof(dp));
        ll L=fn(0,0,0,1,a)/2;
        cout<<(R-L)<<"\n";
        // cout<<a<<" "<<L<<" "<<b<<" "<<R<<"\n";
    }    
}   