import java.util.*;
class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int s = sc.nextInt();
	int e = sc.nextInt();
	int cnt = 0;
	for(int i = s; i<=e; i++) {
	    int rev = getRev(i);
	    if(i==rev) {
		cnt++;
	    }
	}
	System.out.println(cnt);
    }
    public static int getRev(int i) {
	int ic = 0;
	while(i>0) {
	    ic = ic*10+i%10;
	    i /= 10;
	}
	return ic;
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int s = sc.nextInt();
	int e = sc.nextInt();
	int cnt = 0;
	for(int i = s; i<=e; i++) {
	    int rev = getRev(i);
	    if(i==rev) {
		cnt++;
	    }
	}
	System.out.println(cnt);
    }
    public static int getRev(int i) {
	int ic = 0;
	while(i>0) {
	    ic = ic*10+i%10;
	    i /= 10;
	}
	return ic;
    }
} Main public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int s = sc.nextInt();
	int e = sc.nextInt();
	int cnt = 0;
	for(int i = s; i<=e; i++) {
	    int rev = getRev(i);
	    if(i==rev) {
		cnt++;
	    }
	}
	System.out.println(cnt);
    } main {
	Scanner sc = new Scanner(System.in);
	int s = sc.nextInt();
	int e = sc.nextInt();
	int cnt = 0;
	for(int i = s; i<=e; i++) {
	    int rev = getRev(i);
	    if(i==rev) {
		cnt++;
	    }
	}
	System.out.println(cnt);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int e = sc.nextInt(); e sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 for(int i = s; i<=e; i++) {
	    int rev = getRev(i);
	    if(i==rev) {
		cnt++;
	    }
	} int i = s; int i = s; i s i<=e i e i++ i++ i {
	    int rev = getRev(i);
	    if(i==rev) {
		cnt++;
	    }
	} {
	    int rev = getRev(i);
	    if(i==rev) {
		cnt++;
	    }
	} int rev = getRev(i); rev getRev(i) getRev i if(i==rev) {
		cnt++;
	    } i==rev i rev {
		cnt++;
	    } cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public static int getRev(int i) {
	int ic = 0;
	while(i>0) {
	    ic = ic*10+i%10;
	    i /= 10;
	}
	return ic;
    } getRev {
	int ic = 0;
	while(i>0) {
	    ic = ic*10+i%10;
	    i /= 10;
	}
	return ic;
    } int ic = 0; ic 0 while(i>0) {
	    ic = ic*10+i%10;
	    i /= 10;
	} i>0 i 0 {
	    ic = ic*10+i%10;
	    i /= 10;
	} ic = ic*10+i%10 ic ic*10+i%10 ic*10 ic 10 i%10 i 10 i /= 10 i 10 return ic; ic int i i
import java.util.*;
class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int s = sc.nextInt();
	int e = sc.nextInt();
	int cnt = 0;
	for(int i = s; i<=e; i++) {
	    int rev = getRev(i);
	    if(i==rev) {
		cnt++;
	    }
	}
	System.out.println(cnt);
    }
    public static int getRev(int i) {
	int ic = 0;
	while(i>0) {
	    ic = ic*10+i%10;
	    i /= 10;
	}
	return ic;
    }
}