"use strict";
const main = arg => {
  let Min = arg.split(" ")[0];
  let Max = arg.split(" ")[1];
  let cnt = 0;
  for(let i = Min; i <= Max; i++) {
    if(String(i) === String(i).split('').reverse().join('')){
    	cnt++;
    };
  }
  console.log(cnt);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
