import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

int calc(int lo, int hi) {
    // abcba = 10001 * a + 1010 * b + 100 * c
    // 1 <= a <= 9
    // 0 <= b, c <= 9
    int ans = 0;
    for (int a = 1; a <= 9; a++) {
        for (int b = 0; b <= 9; b++) {
            for (int c = 0; c <= 9; c++) {
                int x = 10001 * a + 1010 * b + 100 * c;
                if (lo <= x && x <= hi) {
                    ans++;
                }
            }
        }
    }
    return ans;
}

void main() {
    auto ab = readints;
    int a = ab[0], b = ab[1];
    writeln(calc(a, b));
}
