import java.util.*;
import java.lang.*;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for (int i = 1; i <= 9; i++) {
            for (int j = 0; j <= 9; j++) {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            }
        }
        System.out.println(count);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for (int i = 1; i <= 9; i++) {
            for (int j = 0; j <= 9; j++) {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            }
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for (int i = 1; i <= 9; i++) {
            for (int j = 0; j <= 9; j++) {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            }
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for (int i = 1; i <= 9; i++) {
            for (int j = 0; j <= 9; j++) {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            }
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int count = 0; count 0 for (int i = 1; i <= 9; i++) {
            for (int j = 0; j <= 9; j++) {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            }
        } int i = 1; int i = 1; i 1 i <= 9 i 9 i++ i++ i {
            for (int j = 0; j <= 9; j++) {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            }
        } {
            for (int j = 0; j <= 9; j++) {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            }
        } for (int j = 0; j <= 9; j++) {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            } int j = 0; int j = 0; j 0 j <= 9 j 9 j++ j++ j {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            } {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            } for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                } int k = 0; int k = 0; k 0 k <= 9 k 9 k++ k++ k {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                } {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                } if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    } i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b i * 10001 + j * 1010 + k * 100 >= a i * 10001 + j * 1010 + k * 100 i * 10001 + j * 1010 + k * 100 i * 10001 i 10001 j * 1010 j 1010 k * 100 k 100 a i * 10001 + j * 1010 + k * 100 <= b i * 10001 + j * 1010 + k * 100 i * 10001 + j * 1010 + k * 100 i * 10001 i 10001 j * 1010 j 1010 k * 100 k 100 b {
                        count++;
                    } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for (int i = 1; i <= 9; i++) {
            for (int j = 0; j <= 9; j++) {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            }
        }
        System.out.println(count);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for (int i = 1; i <= 9; i++) {
            for (int j = 0; j <= 9; j++) {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            }
        }
        System.out.println(count);
    }
} Main
import java.util.*;
import java.lang.*;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for (int i = 1; i <= 9; i++) {
            for (int j = 0; j <= 9; j++) {
                for (int k = 0; k <= 9; k++) {
                    if (i * 10001 + j * 1010 + k * 100 >= a && i * 10001 + j * 1010 + k * 100 <= b) {
                        count++;
                    }
                }
            }
        }
        System.out.println(count);
    }
}