#include <bits/stdc++.h>
#define int long long
#define ull unsigned long long
#define mod 998244353
#define MOD 1000000007
using namespace std;
/*
template <typename T>
inline int into ()
{
int s = 0,w = 1;
char ch = getchar ();
while (ch < '0' || ch > '9')
{
if (ch == '-')
w = -1;
ch = getchar ();
}
while (ch >= '0' && ch <= '9')
s = s * 10 + ch - '0',
ch = getchar ();
return s * w;
}
*/
const int N = 1e5 + 5;
int a [N];
signed main () {
ios :: sync_with_stdio (false);
cin.tie (0),cout.tie (0);
int a,b;
cin >> a >> b;
int ans = 0;
for (int i = a;i <= b;i ++)
{
int flag = 1;
int t = i;
int c = 0;
int x = 0;
while (t)
{
x = t % 10;
if (c >= x)
{
flag = 0;
break;
}
c = x;
t /= 10;
}
if (flag) ans ++;
}
cout << ans;
return 0;
}