import java.io.PrintWriter;
import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        int cnt = 0;

        String a = sc.next();
        String b = sc.next();

        int tmpA = Integer.parseInt(a);
        int tmpB = Integer.parseInt(b);

        for (int i=tmpA; i<=tmpB; i++) {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String afterS = sb.reverse().toString();
            if (str.equals(afterS)) cnt++;
        }

        out.print(cnt);
        out.flush();
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.*; util.* java public class Main {

    Scanner sc = new Scanner(System.in);

    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        int cnt = 0;

        String a = sc.next();
        String b = sc.next();

        int tmpA = Integer.parseInt(a);
        int tmpB = Integer.parseInt(b);

        for (int i=tmpA; i<=tmpB; i++) {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String afterS = sb.reverse().toString();
            if (str.equals(afterS)) cnt++;
        }

        out.print(cnt);
        out.flush();
    }
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {

        int cnt = 0;

        String a = sc.next();
        String b = sc.next();

        int tmpA = Integer.parseInt(a);
        int tmpB = Integer.parseInt(b);

        for (int i=tmpA; i<=tmpB; i++) {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String afterS = sb.reverse().toString();
            if (str.equals(afterS)) cnt++;
        }

        out.print(cnt);
        out.flush();
    } run {

        int cnt = 0;

        String a = sc.next();
        String b = sc.next();

        int tmpA = Integer.parseInt(a);
        int tmpB = Integer.parseInt(b);

        for (int i=tmpA; i<=tmpB; i++) {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String afterS = sb.reverse().toString();
            if (str.equals(afterS)) cnt++;
        }

        out.print(cnt);
        out.flush();
    } int cnt = 0; cnt 0 String a = sc.next(); a sc.next() sc.next sc String b = sc.next(); b sc.next() sc.next sc int tmpA = Integer.parseInt(a); tmpA Integer.parseInt(a) Integer.parseInt Integer a int tmpB = Integer.parseInt(b); tmpB Integer.parseInt(b) Integer.parseInt Integer b for (int i=tmpA; i<=tmpB; i++) {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String afterS = sb.reverse().toString();
            if (str.equals(afterS)) cnt++;
        } int i=tmpA; int i=tmpA; i tmpA i<=tmpB i tmpB i++ i++ i {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String afterS = sb.reverse().toString();
            if (str.equals(afterS)) cnt++;
        } {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String afterS = sb.reverse().toString();
            if (str.equals(afterS)) cnt++;
        } String str = String.valueOf(i); str String.valueOf(i) String.valueOf String i StringBuffer sb = new StringBuffer(str); sb new StringBuffer(str) String afterS = sb.reverse().toString(); afterS sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb if (str.equals(afterS)) cnt++; str.equals(afterS) str.equals str afterS cnt++ cnt out.print(cnt) out.print out cnt out.flush() out.flush out public class Main {

    Scanner sc = new Scanner(System.in);

    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        int cnt = 0;

        String a = sc.next();
        String b = sc.next();

        int tmpA = Integer.parseInt(a);
        int tmpB = Integer.parseInt(b);

        for (int i=tmpA; i<=tmpB; i++) {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String afterS = sb.reverse().toString();
            if (str.equals(afterS)) cnt++;
        }

        out.print(cnt);
        out.flush();
    }
} public class Main {

    Scanner sc = new Scanner(System.in);

    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        int cnt = 0;

        String a = sc.next();
        String b = sc.next();

        int tmpA = Integer.parseInt(a);
        int tmpB = Integer.parseInt(b);

        for (int i=tmpA; i<=tmpB; i++) {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String afterS = sb.reverse().toString();
            if (str.equals(afterS)) cnt++;
        }

        out.print(cnt);
        out.flush();
    }
} Main
import java.io.PrintWriter;
import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        int cnt = 0;

        String a = sc.next();
        String b = sc.next();

        int tmpA = Integer.parseInt(a);
        int tmpB = Integer.parseInt(b);

        for (int i=tmpA; i<=tmpB; i++) {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String afterS = sb.reverse().toString();
            if (str.equals(afterS)) cnt++;
        }

        out.print(cnt);
        out.flush();
    }
}