#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,siz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A7CiAgICAgICAgaW50IG14PSh0aWdodD8oc1tpXS0nMCcpOjkpOwogICAgICAgIGYoaiwwLG14KzEpCiAgICAgICAgICAgIGFucys9KGZuKGkrMSx0b3Qsb3RoZXIraix0aWdodCYmKGo9PW14KSxzKStmbihpKzEsdG90K2osb3RoZXIsdGlnaHQmJihqPT1teCkscykpOwogICAgfQogICAgcmV0dXJuIGFuczsKfQoKaW50IG1haW4oKQp7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKICAgIGNpbi50aWUoTlVMTCk7CiAgICAvLyBmcmVvcGVuKCJnaWZ0MS5pbiIsInIiLHN0ZGluKTsKICAgIC8vIGZyZW9wZW4oImdpZnQxLm91dCIsInciLHN0ZG91dCk7CiNpZm5kZWYgT05MSU5FX0pVREdFCiAgICBmcmVvcGVuKCJpbnB1dC50eHQiLCJyIixzdGRpbik7CiAgICBmcmVvcGVuKCJvdXRwdXQudHh0IiwidyIsc3Rkb3V0KTsKI2VuZGlmCiAgICBpbnQgej0xOwogICAgLy8gY2luPj56OwogICAgd2hpbGUoMSkKICAgIHsgCiAgICAgICAgc3RyaW5nIGEsYjsKICAgICAgICBjaW4+PmE+PmI7CiAgICAgICAgaWYoYT09IjAiICYmIGI9PSIwIikKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgbWVtc2V0KGRwLC0xLHNpemVvZihkcCkpOwogICAgICAgIGxsIFI9Zm4oMCwwLDAsMSxiKS8yOwogICAgICAgIGxsIHZhbD1zdG9pKGEpLTE7CiAgICAgICAgYT10b19zdHJpbmcodmFsKTsKICAgICAgICBtZW1zZXQoZHAsLTEsc2l6ZW9mKGRwKSk7CiAgICAgICAgbGwgTD1mbigwLDAsMCwxLGEpLzI7CiAgICAgICAgY291dDw8KFItTCk8PCJcbiI7CiAgICAgICAgLy8gY291dDw8YTw8IiAiPDxMPDwiICI8PGI8PCIgIjw8Ujw8IlxuIjsKICAgIH0gICAgCn0gICA=