import std.stdio;
import std.conv;
import std.algorithm;
import std.string;
import std.array;

void main() {
    auto l = readln.chomp.split.map!(to!int).array;

    int a = l[0], b = l[1];
    int ans;

    for (int i = a; i <= b; ++i) {
        auto s = i.to!(string), t = s.map!(to!char).array.reverse;

        if (s == t) {
            ans++;
        }
    }

    writeln(ans);

    return;
}
