import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

void readV(T...)(ref T t){auto r=readln.splitter;foreach(ref v;t){v=r.front.to!(typeof(v));r.popFront;}}

void main()
{
  int a, b; readV(a, b);

  auto c = 0;
  foreach (i; a..b+1) {
    auto s = i.to!string, t = s.dup;
    t.reverse();
    if (s == t) ++c;
  }

  writeln(c);
}
