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

void main(){
	auto inputs = readln.chomp.split.map!(to!int).array;
    auto answer = iota(inputs[0],inputs[1]+1).map!(to!string).filter!is_palindromic.array.length;
    writeln(answer);
}

bool is_palindromic(string target){
    foreach(i,c; target) {
        if(c != target[$-i-1]){return false;}
    }
    return true;
}