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

void main() {
    auto tmp = readln.split.to!(int[]);
    iota(tmp[0], tmp[1]+1).filter!(i => i.to!string.pipe!(str => str.length.iota.all!(j => str[j] == str[$-j-1]))).walkLength.writeln;
}

