function Main(input){
  var tmp = input.split(' ');
  var count = 0;
  for(var i=Number(tmp[0]);i<=Number(tmp[1]);i++){
    count += check(i);
  }
  function check(num){
    var str = String(num);
    for(var i=0;i<=Math.ceil(num/2);i++){
      if(str[i]!=str[str.length-1-i]){
        return 0;
      }
    }
    return 1;
  }
  console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));