inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
l = inp.shift().split(' ')
A = l[0] - 0
B = l[1] - 0
cnt = 0
for (i=A; i<=B; i++) {
    s = i+''
    if (s[0] == s[4] && s[1] == s[3]) {
        cnt++
    }
}
console.log(cnt)