#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#define LL long long
using namespace std;
bool mem[55][1055];
LL dp[55][1055];
LL f(int dig,int sum)
{
if(dig==0)
return (sum==500);
if(mem[dig][sum])
return dp[dig][sum];
mem[dig][sum]=1;
LL ret=0LL;
for(int i=0;i<=9;++i)
{
if(dig%2)
ret+=f(dig-1,sum+i);
else
ret+=f(dig-1,sum-i);
}
dp[dig][sum]=ret;
return ret;
}
LL solve(string x)
{
LL ret=0;
int len=x.size();
int sum=501;int qued=len;
for(int i=0;i<len;++i)
{
qued--;
int d=x[i]-'0';
for(int j=0;j<d;++j)
{
if(qued%2)
ret+=(f(qued,sum+j));
else
ret+=(f(qued,sum-j));
}
if(qued%2)
sum+=d;
else
sum-=d;
}
return ret;
}
int main()
{
string a,b;cin>>b>>a;
vector<int> tmp;
for(int i=0;i<a.size();++i)
{
tmp.push_back(a[i]-'0');
}
reverse(tmp.begin(),tmp.end());
for(int i=0;i<tmp.size();++i)
{
if(tmp[i]<9)
{
tmp[i]++;break;
}
else
{
tmp[i]=0;
}
}
if(tmp[tmp.size()-1]==0)tmp.push_back(1);
reverse(tmp.begin(),tmp.end());
vector<char> t;
for(int i=0;i<tmp.size();++i)
{
t.push_back((char)(48+tmp[i]));
}
string s(t.begin(),t.end());
//cout<<s<<endl;
cout<<solve(s)-solve(b)<<endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGlvPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojZGVmaW5lIExMIGxvbmcgbG9uZwp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKYm9vbCBtZW1bNTVdWzEwNTVdOwpMTCBkcFs1NV1bMTA1NV07CkxMIGYoaW50IGRpZyxpbnQgc3VtKQp7CiAgICBpZihkaWc9PTApCiAgICAgICAgcmV0dXJuIChzdW09PTUwMCk7CiAgICBpZihtZW1bZGlnXVtzdW1dKQogICAgICAgIHJldHVybiBkcFtkaWddW3N1bV07CiAgICBtZW1bZGlnXVtzdW1dPTE7CiAgICBMTCByZXQ9MExMOwogICAgZm9yKGludCBpPTA7aTw9OTsrK2kpCiAgICB7CiAgICAgICAgaWYoZGlnJTIpCiAgICAgICAgcmV0Kz1mKGRpZy0xLHN1bStpKTsKICAgICAgICBlbHNlCiAgICAgICAgcmV0Kz1mKGRpZy0xLHN1bS1pKTsKICAgIH0KICAgIGRwW2RpZ11bc3VtXT1yZXQ7CiAgICByZXR1cm4gcmV0Owp9CgpMTCBzb2x2ZShzdHJpbmcgeCkKewogICAgTEwgcmV0PTA7CiAgICBpbnQgbGVuPXguc2l6ZSgpOwogICAgaW50IHN1bT01MDE7aW50IHF1ZWQ9bGVuOwogICAgZm9yKGludCBpPTA7aTxsZW47KytpKQogICAgewogICAgICAgIHF1ZWQtLTsKICAgICAgICBpbnQgZD14W2ldLScwJzsKICAgICAgICBmb3IoaW50IGo9MDtqPGQ7KytqKQogICAgICAgIHsKICAgICAgICAgICAgaWYocXVlZCUyKQogICAgICAgICAgICByZXQrPShmKHF1ZWQsc3VtK2opKTsKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICByZXQrPShmKHF1ZWQsc3VtLWopKTsKICAgICAgICB9CiAgICAgICAgaWYocXVlZCUyKQogICAgICAgIHN1bSs9ZDsKICAgICAgICBlbHNlCiAgICAgICAgc3VtLT1kOwogICAgfQogICAgCiAgICByZXR1cm4gcmV0Owp9CiAgICAKCmludCBtYWluKCkKewogIHN0cmluZyBhLGI7Y2luPj5iPj5hOwogIAogICB2ZWN0b3I8aW50PiB0bXA7CiAgIGZvcihpbnQgaT0wO2k8YS5zaXplKCk7KytpKQogICB7CiAgICAgICB0bXAucHVzaF9iYWNrKGFbaV0tJzAnKTsKICAgfQogICByZXZlcnNlKHRtcC5iZWdpbigpLHRtcC5lbmQoKSk7CiAgIGZvcihpbnQgaT0wO2k8dG1wLnNpemUoKTsrK2kpCiAgIHsKICAgICAgIGlmKHRtcFtpXTw5KQogICAgICAgewogICAgICAgICAgIHRtcFtpXSsrO2JyZWFrOwogICAgICAgfQogICAgICAgZWxzZQogICAgICAgewogICAgICAgICAgIHRtcFtpXT0wOwogICAgICAgfQogICB9CiAgIGlmKHRtcFt0bXAuc2l6ZSgpLTFdPT0wKXRtcC5wdXNoX2JhY2soMSk7CiAgICByZXZlcnNlKHRtcC5iZWdpbigpLHRtcC5lbmQoKSk7CiAgIHZlY3RvcjxjaGFyPiB0OwogICBmb3IoaW50IGk9MDtpPHRtcC5zaXplKCk7KytpKQogICB7CiAgICAgICB0LnB1c2hfYmFjaygoY2hhcikoNDgrdG1wW2ldKSk7CiAgIH0KICAgc3RyaW5nIHModC5iZWdpbigpLHQuZW5kKCkpOwogICAvL2NvdXQ8PHM8PGVuZGw7CiAgIGNvdXQ8PHNvbHZlKHMpLXNvbHZlKGIpPDxlbmRsOwogICByZXR1cm4gMDsKfQo=