'use strict'

function main(s) {
  s = s.split('\n')[0].split(' ').map(n => Number(n));

  const start = s[0];
  const last  = s[1];
  let count = 0;

  for (let i = start; i <= last; i++) {
    const str = String(i);
    const reverse_str = str.split('').reverse().join('');
    if (str === reverse_str) {
      count += 1;
    }
  }

  console.log(count);
}

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