"use strict";
    
const main = arg => {
    const A = arg.split("\n")[0].split(" ")[0];
    const B = arg.split("\n")[0].split(" ")[1];
    let cnt = 0;
    
    for(let i=A; i<=B; i++) {
        if(String(i) == String(i).split("").reverse().join("")) {
            cnt++;
        }
    }
    
    console.log(cnt);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
