//package Contest090;

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String []args)
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int first = sc.nextInt(),last = sc.nextInt();
        int cnt =0;
        for(int i = first;i<=last;i++)
        {
            String str1 = String.valueOf(i);
            StringBuilder sb = new StringBuilder(str1);
            sb = sb.reverse();
            String temp = sb.toString();
            //out.println(str1+" "+temp);
            if(str1.equals(temp))
                cnt++;

        }
        out.println(cnt);

        out.flush();
    }

} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String []args)
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int first = sc.nextInt(),last = sc.nextInt();
        int cnt =0;
        for(int i = first;i<=last;i++)
        {
            String str1 = String.valueOf(i);
            StringBuilder sb = new StringBuilder(str1);
            sb = sb.reverse();
            String temp = sb.toString();
            //out.println(str1+" "+temp);
            if(str1.equals(temp))
                cnt++;

        }
        out.println(cnt);

        out.flush();
    }

} Main public static void main(String []args)
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int first = sc.nextInt(),last = sc.nextInt();
        int cnt =0;
        for(int i = first;i<=last;i++)
        {
            String str1 = String.valueOf(i);
            StringBuilder sb = new StringBuilder(str1);
            sb = sb.reverse();
            String temp = sb.toString();
            //out.println(str1+" "+temp);
            if(str1.equals(temp))
                cnt++;

        }
        out.println(cnt);

        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int first = sc.nextInt(),last = sc.nextInt();
        int cnt =0;
        for(int i = first;i<=last;i++)
        {
            String str1 = String.valueOf(i);
            StringBuilder sb = new StringBuilder(str1);
            sb = sb.reverse();
            String temp = sb.toString();
            //out.println(str1+" "+temp);
            if(str1.equals(temp))
                cnt++;

        }
        out.println(cnt);

        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int first = sc.nextInt() first sc.nextInt() sc.nextInt sc last = sc.nextInt(); last sc.nextInt() sc.nextInt sc int cnt =0; cnt 0 for(int i = first;i<=last;i++)
        {
            String str1 = String.valueOf(i);
            StringBuilder sb = new StringBuilder(str1);
            sb = sb.reverse();
            String temp = sb.toString();
            //out.println(str1+" "+temp);
            if(str1.equals(temp))
                cnt++;

        } int i = first; int i = first; i first i<=last i last i++ i++ i {
            String str1 = String.valueOf(i);
            StringBuilder sb = new StringBuilder(str1);
            sb = sb.reverse();
            String temp = sb.toString();
            //out.println(str1+" "+temp);
            if(str1.equals(temp))
                cnt++;

        } {
            String str1 = String.valueOf(i);
            StringBuilder sb = new StringBuilder(str1);
            sb = sb.reverse();
            String temp = sb.toString();
            //out.println(str1+" "+temp);
            if(str1.equals(temp))
                cnt++;

        } String str1 = String.valueOf(i); str1 String.valueOf(i) String.valueOf String i StringBuilder sb = new StringBuilder(str1); sb new StringBuilder(str1) sb = sb.reverse() sb sb.reverse() sb.reverse sb String temp = sb.toString(); temp sb.toString() sb.toString sb if(str1.equals(temp))
                cnt++; str1.equals(temp) str1.equals str1 temp cnt++ cnt out.println(cnt) out.println out cnt out.flush() out.flush out String []args args public class Main {
    public static void main(String []args)
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int first = sc.nextInt(),last = sc.nextInt();
        int cnt =0;
        for(int i = first;i<=last;i++)
        {
            String str1 = String.valueOf(i);
            StringBuilder sb = new StringBuilder(str1);
            sb = sb.reverse();
            String temp = sb.toString();
            //out.println(str1+" "+temp);
            if(str1.equals(temp))
                cnt++;

        }
        out.println(cnt);

        out.flush();
    }

} public class Main {
    public static void main(String []args)
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int first = sc.nextInt(),last = sc.nextInt();
        int cnt =0;
        for(int i = first;i<=last;i++)
        {
            String str1 = String.valueOf(i);
            StringBuilder sb = new StringBuilder(str1);
            sb = sb.reverse();
            String temp = sb.toString();
            //out.println(str1+" "+temp);
            if(str1.equals(temp))
                cnt++;

        }
        out.println(cnt);

        out.flush();
    }

} Main
//package Contest090;

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String []args)
    {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int first = sc.nextInt(),last = sc.nextInt();
        int cnt =0;
        for(int i = first;i<=last;i++)
        {
            String str1 = String.valueOf(i);
            StringBuilder sb = new StringBuilder(str1);
            sb = sb.reverse();
            String temp = sb.toString();
            //out.println(str1+" "+temp);
            if(str1.equals(temp))
                cnt++;

        }
        out.println(cnt);

        out.flush();
    }

}
