import java.util.*;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int a = Integer.parseInt(sc.next());
    	int b = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=a; i<=b; i++){
    		String string_i = String.valueOf(i);
    		StringBuffer sb = new StringBuffer(string_i);
    		if (string_i.equals(sb.reverse().toString())){
    			ans += 1;
    		}
    	}

    	System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int a = Integer.parseInt(sc.next());
    	int b = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=a; i<=b; i++){
    		String string_i = String.valueOf(i);
    		StringBuffer sb = new StringBuffer(string_i);
    		if (string_i.equals(sb.reverse().toString())){
    			ans += 1;
    		}
    	}

    	System.out.println(ans);
    }
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int a = Integer.parseInt(sc.next());
    	int b = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=a; i<=b; i++){
    		String string_i = String.valueOf(i);
    		StringBuffer sb = new StringBuffer(string_i);
    		if (string_i.equals(sb.reverse().toString())){
    			ans += 1;
    		}
    	}

    	System.out.println(ans);
    } main {
    	Scanner sc = new Scanner(System.in);
    	int a = Integer.parseInt(sc.next());
    	int b = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=a; i<=b; i++){
    		String string_i = String.valueOf(i);
    		StringBuffer sb = new StringBuffer(string_i);
    		if (string_i.equals(sb.reverse().toString())){
    			ans += 1;
    		}
    	}

    	System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ans = 0; ans 0 for (int i=a; i<=b; i++){
    		String string_i = String.valueOf(i);
    		StringBuffer sb = new StringBuffer(string_i);
    		if (string_i.equals(sb.reverse().toString())){
    			ans += 1;
    		}
    	} int i=a; int i=a; i a i<=b i b i++ i++ i {
    		String string_i = String.valueOf(i);
    		StringBuffer sb = new StringBuffer(string_i);
    		if (string_i.equals(sb.reverse().toString())){
    			ans += 1;
    		}
    	} {
    		String string_i = String.valueOf(i);
    		StringBuffer sb = new StringBuffer(string_i);
    		if (string_i.equals(sb.reverse().toString())){
    			ans += 1;
    		}
    	} String string_i = String.valueOf(i); string_i String.valueOf(i) String.valueOf String i StringBuffer sb = new StringBuffer(string_i); sb new StringBuffer(string_i) if (string_i.equals(sb.reverse().toString())){
    			ans += 1;
    		} string_i.equals(sb.reverse().toString()) string_i.equals string_i sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb {
    			ans += 1;
    		} ans += 1 ans 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int a = Integer.parseInt(sc.next());
    	int b = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=a; i<=b; i++){
    		String string_i = String.valueOf(i);
    		StringBuffer sb = new StringBuffer(string_i);
    		if (string_i.equals(sb.reverse().toString())){
    			ans += 1;
    		}
    	}

    	System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int a = Integer.parseInt(sc.next());
    	int b = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=a; i<=b; i++){
    		String string_i = String.valueOf(i);
    		StringBuffer sb = new StringBuffer(string_i);
    		if (string_i.equals(sb.reverse().toString())){
    			ans += 1;
    		}
    	}

    	System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int a = Integer.parseInt(sc.next());
    	int b = Integer.parseInt(sc.next());

    	int ans = 0;

    	for (int i=a; i<=b; i++){
    		String string_i = String.valueOf(i);
    		StringBuffer sb = new StringBuffer(string_i);
    		if (string_i.equals(sb.reverse().toString())){
    			ans += 1;
    		}
    	}

    	System.out.println(ans);
    }
}