#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <iomanip>
#define uint unsigned int
#define INF 999999999
#define ll long long
#define M 1000000007
#define E 0.0000001
#define N 131072
using namespace std;
/**
332617
=> 333222
332217
=> 332222
44238
=> 44242
44248
=> 44333
22362
=> 22422
22316
=> 22322
22438
=> 22442
*/
int main () {
ll a, b;
cin>>a>>b;
ll ans = 0;
for (int i = a; i <= b; i++) {
int t = i;
set<char> c;
while (t) {
c.insert((char)((t % 10) + '0'));
t /= 10;
}
if (c.size() == 2 && c.count('0') == 0) ans++;
}
cout<<ans<<endl;
return 0;
}
/*int main () { // WIP-koodi, joka ei toimi vielä.
string a, b;
cin>>a>>b;
long long ans = 0;
long long multi = 2;
for (int i = a.length(); i <= b.length(); i++) {
int x = multi - 1;
ans += x * 9 * 8;
if (i == a.length()) {
int f = (int)(a[0] - '0');
ans -= x * (f - 1) * 8;
string c = a;
int s = -1;
int si = -1;
int sf = -1;
bool d = false;
for (int z = 1; z < i; z++) {
int q = (int)(a[z] - '0');
if (s == -1) {
if (q != f) {
s = q;
si = z;
sf = z;
}
} else if (!d) {
if (q == s) si = z;
if (q != s && q != f) {
if (s < f) {
if (q < s) c[z] = (char)(s + '0');
else if (q < f) {
c[z] = (char)(f + '0');
} else if (s + 1 == f) {
c[si] = (char)(f + '0');
for (int tx = si; tx < z; tx++) c[tx + 1] = (char)(s + '0');
} else {
s++;
for (int tx = sf; tx <= z; tx++) c[tx] = (char)(s + '0');
}
} else {
if (q < f) c[z] = (char)(f + '0');
else if (q < s) {
c[z] = (char)(s + '0');
} else if ((c[z - 1] - '0') == s) {
s++;
if (s == f) s++;
if (s == 10) s = 0;
c[sf] = (char)(s + '0');
for (int tx = sf; tx < z; tx++) c[tx + 1] = (char)(f + '0');
} else {
c[z] = (char)(f + '0');
c[z - 1] = (char)(s + '0');
}
}
d = true;
}
} else {
c[z] = (char)(min(s, f) + '0');
}
}
if (s == -1) {
ans -= x * 8;
} else {
int pe = 0;
if (f < s) {
for (int i = 1; i < c.length(); i++) {
if (c[c.length() - i] == (s + '0')) pe += 1<<(i - 1);
}
ans -= (s - 2) * x;
}
else {
pe = (1<<(c.length() - 1)) - 1;
for (int i = 1; i < c.length(); i++) {
if (c[i] == (s + '0')) pe -= 1<<(i - 1);
}
ans -= (s - 2) * x;
}
cout<<pe<<" "<<ans<<endl;
ans -= pe - 1;
cout<<ans<<endl;
}
cout<<c<<endl;
}
if (i == b.length()) {
}
multi *= 2;
}
cout<<ans<<endl;
return 0;
}*/
/**
222223
1*****
21****
**/
/**
((2^(len-1)) - 1) * 72
72 = 1 * 3 * 3 * 2 * 2 * 2
216 = 3 * 3 * 3 * 2 * 2 * 2
504 = 7 * 3 * 3 * 2 * 2 * 2
1080 = 15 * 3 * 3 * 2 * 2 * 2
2232 = 31 * 3 * 3 * 2 * 2 * 2
permutations:
1
*/