import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int B = scanner.nextInt();

        int cnt = 0;

        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            }
        }
        System.out.println(cnt);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Comparator; Comparator java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int B = scanner.nextInt();

        int cnt = 0;

        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            }
        }
        System.out.println(cnt);
    }
} Main public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int B = scanner.nextInt();

        int cnt = 0;

        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            }
        }
        System.out.println(cnt);
    } main {
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int B = scanner.nextInt();

        int cnt = 0;

        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            }
        }
        System.out.println(cnt);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int A = scanner.nextInt(); A scanner.nextInt() scanner.nextInt scanner int B = scanner.nextInt(); B scanner.nextInt() scanner.nextInt scanner int cnt = 0; cnt 0 for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            }
        } int i = 0; int i = 0; i 0 i < 10 i 10 i++ i++ i {
            for (int j = 0; j < 10; j++) {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            }
        } {
            for (int j = 0; j < 10; j++) {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            }
        } for (int j = 0; j < 10; j++) {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            } int j = 0; int j = 0; j 0 j < 10 j 10 j++ j++ j {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            } {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            } for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                } int k = 1; int k = 1; k 1 k < 10 k 10 k++ k++ k {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                } {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                } int i1 = Integer.parseInt(""  + k + j + i + j + k ); i1 Integer.parseInt(""  + k + j + i + j + k ) Integer.parseInt Integer ""  + k + j + i + j + k j i j ""  + k + j + i + j + k "" k j i j k if (A <= i1 && i1 <= B) cnt++; A <= i1 && i1 <= B A <= i1 A i1 i1 <= B i1 B cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String... args args public class Main {
    public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int B = scanner.nextInt();

        int cnt = 0;

        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            }
        }
        System.out.println(cnt);
    }
} public class Main {
    public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int B = scanner.nextInt();

        int cnt = 0;

        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            }
        }
        System.out.println(cnt);
    }
} Main
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String... args) {
        Scanner scanner = new Scanner(System.in);
        int A = scanner.nextInt();
        int B = scanner.nextInt();

        int cnt = 0;

        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                for (int k = 1; k < 10; k++) {
                    int i1 = Integer.parseInt(""  + k + j + i + j + k );
                    if (A <= i1 && i1 <= B) cnt++;
                }
            }
        }
        System.out.println(cnt);
    }
}
