import std.stdio, std.algorithm, std.string, std.conv, std.array, std.range, std.math, core.stdc.stdio;

int f(int x) {
    string s = x.to!string;
    int r = 1, n = cast(int) s.length;
    foreach(i, c; s) {
        r &= s[i] == s[n-1-i];
    }
    return r;
}

void main() {
    int a, b;
    scanf("%d %d", &a, &b);

    int ans;
    foreach(x; a..b+1)
        ans += f(x);
    ans.writeln;
}