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[] digits(int n) {
    return n.to!string.map!(c => cast(int)c - '0').array;
}

int calc(int a, int b) {
    int ans = 0;
    for (int i = a; i <= b; i++) {
        auto d = digits(i);
        if (d == d.dup.reverse()) {
            ans++;
        }
    }
    return ans;
}

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