void main() {
    string[] tmp = readln.split;
    int a = tmp[0].to!int, b = tmp[1].to!int;
    string p = tmp[0];
    int cnt;
    foreach (i; a .. b+1) {
        char[] q = p.dup;
        reverse(q);
        if (p == q) ++cnt;
        p = p.succ;
    }
    cnt.writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;