import java.io.IOException;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner(System.in);

        int count = 0;

        int x = sc.nextInt();
        int y = sc.nextInt();

        for(int i=x; i<=y; i++) {
        	String[] line = Integer.toString(i).split("");
        	if(line[0].equals(line[4]) && line[1].equals(line[3])) {
        		count++;
        	}
        }

        System.out.println(count);

        sc.close();
    }
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner(System.in);

        int count = 0;

        int x = sc.nextInt();
        int y = sc.nextInt();

        for(int i=x; i<=y; i++) {
        	String[] line = Integer.toString(i).split("");
        	if(line[0].equals(line[4]) && line[1].equals(line[3])) {
        		count++;
        	}
        }

        System.out.println(count);

        sc.close();
    }
} Main public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner(System.in);

        int count = 0;

        int x = sc.nextInt();
        int y = sc.nextInt();

        for(int i=x; i<=y; i++) {
        	String[] line = Integer.toString(i).split("");
        	if(line[0].equals(line[4]) && line[1].equals(line[3])) {
        		count++;
        	}
        }

        System.out.println(count);

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        int count = 0;

        int x = sc.nextInt();
        int y = sc.nextInt();

        for(int i=x; i<=y; i++) {
        	String[] line = Integer.toString(i).split("");
        	if(line[0].equals(line[4]) && line[1].equals(line[3])) {
        		count++;
        	}
        }

        System.out.println(count);

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int count = 0; count 0 int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int y = sc.nextInt(); y sc.nextInt() sc.nextInt sc for(int i=x; i<=y; i++) {
        	String[] line = Integer.toString(i).split("");
        	if(line[0].equals(line[4]) && line[1].equals(line[3])) {
        		count++;
        	}
        } int i=x; int i=x; i x i<=y i y i++ i++ i {
        	String[] line = Integer.toString(i).split("");
        	if(line[0].equals(line[4]) && line[1].equals(line[3])) {
        		count++;
        	}
        } {
        	String[] line = Integer.toString(i).split("");
        	if(line[0].equals(line[4]) && line[1].equals(line[3])) {
        		count++;
        	}
        } String[] line = Integer.toString(i).split(""); line Integer.toString(i).split("") Integer.toString(i).split Integer.toString(i) Integer.toString Integer i "" if(line[0].equals(line[4]) && line[1].equals(line[3])) {
        		count++;
        	} line[0].equals(line[4]) && line[1].equals(line[3]) line[0].equals(line[4]) line[0].equals line[0] line 0 line[4] line 4 line[1].equals(line[3]) line[1].equals line[1] line 1 line[3] line 3 {
        		count++;
        	} count++ count System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner(System.in);

        int count = 0;

        int x = sc.nextInt();
        int y = sc.nextInt();

        for(int i=x; i<=y; i++) {
        	String[] line = Integer.toString(i).split("");
        	if(line[0].equals(line[4]) && line[1].equals(line[3])) {
        		count++;
        	}
        }

        System.out.println(count);

        sc.close();
    }
} public class Main {
    public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner(System.in);

        int count = 0;

        int x = sc.nextInt();
        int y = sc.nextInt();

        for(int i=x; i<=y; i++) {
        	String[] line = Integer.toString(i).split("");
        	if(line[0].equals(line[4]) && line[1].equals(line[3])) {
        		count++;
        	}
        }

        System.out.println(count);

        sc.close();
    }
} Main
import java.io.IOException;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner(System.in);

        int count = 0;

        int x = sc.nextInt();
        int y = sc.nextInt();

        for(int i=x; i<=y; i++) {
        	String[] line = Integer.toString(i).split("");
        	if(line[0].equals(line[4]) && line[1].equals(line[3])) {
        		count++;
        	}
        }

        System.out.println(count);

        sc.close();
    }
}