function Main(input){
	var sum = 0;
	input = input.split(" ").map(Number);
	for(var i=input[0];i<=input[1];i++){
		var n = String(i).split("");
		var p = [];
		for(var k=0;k<n.length;k++){
		    p.push(n[n.length-1-k])
		}
		if(n.join("")==p.join("")) sum++;
	}
	console.log(sum)
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());