stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <bits/stdc++.h>



#define vi vector<int>

#define ii pair<int,int>

#define vii vector<pair<int,int>>

#define vvi vector<vector<int>>



typedef long long ll;

typedef unsigned long long ull;



#define pb push_back

#define mp make_pair

#define fi first

#define se second



using namespace std;



int a,b;

int result = 0;



bool is_palindrome (int k) {

    string s = to_string(k);

    int i = 0;

    int j = s.length()-1;

    while (i <= j) {

        if (s[i] != s[j])

            return false;

        i++;

        j--;

    }

    return true;

}



int main (void) {

    ios_base::sync_with_stdio(false);



    cin >> a >> b;

    for (int i = a; i <= b; i++) {

        if (is_palindrome(i))

            result++;

    }



    cout << result << endl;



    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int nixu (int x)

{

    int a=0;

    while(x>0)

    {

        a=a*10+x%10;

        x=x/10;

    }

    return a;

}

int main()

{

    int a,b,i;

    int sum=0;

    scanf("%d %d",&a,&b);

    for(i=a;i<=b;i++)

    {

        if(i==nixu(i))

            sum++;

    }



    printf("%d",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
/*

** author:mahmoud magdy

*/

#include <bits/stdc++.h>

using namespace std;



#define ll long long

#define endl "\n"



void fast()

{

    ios_base :: sync_with_stdio( 0 ) ;

    cin.tie( 0 ) ;

    cout.tie( 0 ) ;

}

inline int D()

{

    int m ;

    scanf("%d",&m);

    return m ;

}

inline ll lD()

{

    ll m ;

    scanf("%lld",&m);

    return m ;

}

inline double dD()

{

    double m ;

    scanf("%llf",&m);

    return m ;

}

ll LCM(ll a, ll b)

{

    return a / __gcd(a, b) * b;

}

ll power(ll a, ll b, ll m)

{

    if(!b)  return 1;

    ll t = power(a, b>>1, m)%m;

    return ((t*t)%m * (b&1 ? a : 1)%m)%m;

}

bool isPaind(int n){

string s="";

int t=n;

while(n){

    s+=n%10+'0';

 n/=10;

}

 stringstream geek(s);

   int x = 0;

   geek >> x;

   return (x==t);

}

int main()

{

    int x=D(),y=D(),cnt=0;

     for(int i=x;i<=y;++i){

        if(isPaind(i))

            cnt++;

     }

     cout<<cnt<<endl;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int nixu (int x)

{

    int a=0;

    while(x>0)

    {

        a=a*10+x%10;

        x=x/10;

    }

    return a;

}

int main()

{

    int a,b,i;

    int sum=0;

    scanf("%d %d",&a,&b);

    for(i=a;i<=b;i++)

    {

        if(i==nixu(i))

            sum++;

    }



    printf("%d",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<stdio.h>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<vector>

#include<map>

#define ll long long

using namespace std;

int ishui(string s){

	int n=s.size();

	for(int i=0;i<s.size()/2;i++){

		if(s[i]!=s[s.size()-i-1]){

			return 0;

		}

	}

	return 1;

}

int main(){

	ll a,b;

	cin>>a>>b;

	int ans=0;

	for(ll i=a;i<=b;i++){

		string s=to_string(i);

		if(ishui(s)){

			ans++;

		}

	} 

	cout<<ans<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int nixu (int x)

{

    int a=0;

    while(x>0)

    {

        a=a*10+x%10;

        x=x/10;

    }

    return a;

}

int main()

{

    int a,b,i;

    int sum=0;

    scanf("%d %d",&a,&b);

    for(i=a;i<=b;i++)

    {

        if(i==nixu(i))

            sum++;

    }



    printf("%d",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
/**

 *    This code has been written by YueGuang, feel free to ask me question. Blog: http://www.yx.telstudy.xyz

 *    created:

 */

#include <cstdio>

#include <iostream>

#include <set>

#include <map>

#include <algorithm>

#include <cstring>

#include <string>

#include <cmath>

#define REP(i, a, b) for(int i = a; i < b; i++)

#define REP_(i, a, b) for(int i = a; i <= b; i++)

#define sl(n) scanf("%lld", &n);

#define si(n) scanf("%d", &n);

#define RepAll(a) for(auto x: a)

#define cout(ans) cout << ans << endl;

typedef long long ll;



using namespace std;

bool judge(int n){

    string s = to_string(n);

    //cout << s << endl;

    for(int i = 0; i < s.size()/2; i++){  //cout << s[i] << " " << s[s.size() - 1 - i] << endl;

        if (s[i] != s[s.size() - 1 - i]){



            return false;

        }

    }

    return true;

}

int main(){

    int a, b, cnt = 0;

    scanf("%d%d", &a, &b);

    for(int i = a; i <= b; i++){

        if (judge(i)){

            cnt++;

        }

    }

    cout << cnt << endl;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int nixu (int x)

{

    int a=0;

    while(x>0)

    {

        a=a*10+x%10;

        x=x/10;

    }

    return a;

}

int main()

{

    int a,b,i;

    int sum=0;

    scanf("%d %d",&a,&b);

    for(i=a;i<=b;i++)

    {

        if(i==nixu(i))

            sum++;

    }



    printf("%d",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <algorithm>

#include <string>

#include <cmath>

#include <cstdio>

#include <cstring>

#include <sstream>



using namespace std;



const int maxn = 15;

char a[maxn][maxn];

int visit[maxn];

int way = 0;

int cnt = 0;

int n, k;

bool ishuiwen(string a)

{

    string t(a.rbegin(), a.rend());

    if(a == t)

        return 1;

    else

        return 0;

}





int main()

{

    int a, b;

    cin >> a >> b;

    for(int i=a;i<=b;i++)

    {

        string temp;

        stringstream ss;

        ss << i;

        ss >> temp;

        if(ishuiwen(temp))

            cnt++;

    }

    cout << cnt << endl;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int nixu (int x)

{

    int a=0;

    while(x>0)

    {

        a=a*10+x%10;

        x=x/10;

    }

    return a;

}

int main()

{

    int a,b,i;

    int sum=0;

    scanf("%d %d",&a,&b);

    for(i=a;i<=b;i++)

    {

        if(i==nixu(i))

            sum++;

    }



    printf("%d",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

typedef pair<int,int> pi;



int main() {

	ios_base::sync_with_stdio(0);

	cin.tie(0);

	int a,b;

	cin >> a >> b;

	int ans = 0;

	for (int i = a; i <= b; i++) {

		string str = to_string(i);

		bool flag = true;

		for (int j = 0; j < (int)str.length()/2; j++) {

			if (str[j] == str[str.length()-1-j]) continue;

			else {

				flag = false;

				break;

			}

		}

		if (flag) ans++;

	}

	cout << ans;

	return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int nixu (int x)

{

    int a=0;

    while(x>0)

    {

        a=a*10+x%10;

        x=x/10;

    }

    return a;

}

int main()

{

    int a,b,i;

    int sum=0;

    scanf("%d %d",&a,&b);

    for(i=a;i<=b;i++)

    {

        if(i==nixu(i))

            sum++;

    }



    printf("%d",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<stdio.h>

#include<math.h>

#include<string.h>

#include<iostream>

#include<algorithm>

using namespace std;

int hui(int n)

{

	int k=0;	int m,h=0;

	while(n>0)

	{

		m=n%10;

		n=n/10;

		h=h*10+m; 

	}

	return h;

}

int main()

{

	int a,b;

	scanf("%d%d",&a,&b);

	int h=0;

	for(int i=a;i<=b;i++)

	{

		int b=hui(i);

		if(b==i)

		h++;

	}

	printf("%d\n",h);

	return 0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int nixu (int x)

{

    int a=0;

    while(x>0)

    {

        a=a*10+x%10;

        x=x/10;

    }

    return a;

}

int main()

{

    int a,b,i;

    int sum=0;

    scanf("%d %d",&a,&b);

    for(i=a;i<=b;i++)

    {

        if(i==nixu(i))

            sum++;

    }



    printf("%d",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int main(){

    int a, b, ans = 0;

    cin >> a >> b;



    for(int i = a; i <= b; i++){

        if(i/10000 == i%10 && i/1000%10 == i/10%10){

            ans++;

            // cout << i << endl;

        }

    }

    cout << ans << endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main(void){

 

	int in[2]={0};

	

	int i;

	int count=0;

	int rev=0,num=0;

	scanf("%d %d",&in[0],&in[1]);

	

	

	for(i=in[0];i<=in[1];i++){

		

		num=i;

		rev=0;

		while(num>0){

			rev=rev*10+num%10;

			num/=10;

		}

		

		if(i==rev){

			count++;

		}

	}

	

	printf("%d",count);	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

 

typedef long long ll;

typedef vector<pair<ll, ll>> pll;

 

#define mod 1000000007

#define all(x) (x).begin(), (x).end()

#define pb push_back

#define popcount(x) __builtin_popcountll(x)

 

const long double PI = acos(-1);

 

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}

ll lcm(ll a,ll b){return a / gcd(a,b) * b;}

ll stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);}

bool isInteger(double x){return floor(x) == x;}



int main(){

  ios::sync_with_stdio(false);

  cin.tie(0);



  ll a, b;

  cin >> a >> b;

  ll ans = 0;

  for(ll i = a; i <= b; i++){

    if(i/10000 == i%10 && i/1000%10 == i/10%10) ans++;

  }

  cout << ans << endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main(void){

 

	int in[2]={0};

	

	int i;

	int count=0;

	int rev=0,num=0;

	scanf("%d %d",&in[0],&in[1]);

	

	

	for(i=in[0];i<=in[1];i++){

		

		num=i;

		rev=0;

		while(num>0){

			rev=rev*10+num%10;

			num/=10;

		}

		

		if(i==rev){

			count++;

		}

	}

	

	printf("%d",count);	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

 

typedef long long ll;

typedef vector<pair<ll, ll>> pll;

 

#define mod 1000000007

#define all(x) (x).begin(), (x).end()

#define pb push_back

#define popcount(x) __builtin_popcountll(x)

 

const long double PI = acos(-1);

 

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}

ll lcm(ll a,ll b){return a / gcd(a,b) * b;}

ll stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);}

bool isInteger(double x){return floor(x) == x;}

 

int main(){

  ios::sync_with_stdio(false);

  cin.tie(0);

 

	int in[2]={0};

	

	char tmp;

	int i,j;

	int count=0;

	int rev=0,num=0;

	scanf("%d %d",&in[0],&in[1]);

	

	for(i=in[0];i<=in[1];i++){

		

		num=i;

		rev=0;

		while(num>0){

			rev=rev*10+num%10;

			num/=10;

		}

		

		if(i==rev){

			count++;

		}

	}

	

	printf("%d",count);	

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>

 

int main(void){

 

	int in[2]={0};

	

	int i;

	int count=0;

	int rev=0,num=0;

	scanf("%d %d",&in[0],&in[1]);

	

	

	for(i=in[0];i<=in[1];i++){

		

		num=i;

		rev=0;

		while(num>0){

			rev=rev*10+num%10;

			num/=10;

		}

		

		if(i==rev){

			count++;

		}

	}

	

	printf("%d",count);	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;

using ll=long long;

using vi=vector<int>;

using vl=vector<ll>;

using vs=vector<string>;



#define pb push_back

#define pf push_front

#define mp make_pair

#define fi first

#define se second

#define All(s) s.begin(),s.end()

#define rAll(s) s.rbegin(),s.rend()

#define rep(i, a, n) for (int i = (n); i < (a); ++i)

#define repr(i, a, n) for (int i = (n); i >= (a); --i)



template<typename T,typename U>

void Inparray(T &f,U n){

  for(int i=0;i<n;i++) cin>>f[i];

}



template<typename T,typename U>

void Printarray(T f,U n){

  for(int i=0;i<n;i++) i!=n ? cout<<f[i]<<" " : cout<<f[i];

}



void flagfunc(bool flag,string A,string B){

  flag ? cout<<A<<endl : cout<<B<<endl;

}



void flag2func(bool flag){

  flag ? cout<<"Yes"<<endl : cout<<"No"<<endl;

}



void flag3func(bool flag){

  flag ? cout<<"YES"<<endl : cout<<"NO"<<endl;

}



int main(){

  cin.tie(nullptr);ios_base::sync_with_stdio(false);

  cout << fixed << setprecision(15);

  int a,b;cin>>a>>b;

  string c;

  int ans=0;

  for (int i = a; i <= b; ++i){

  	c=to_string(i);

  	if ((c[0]==c[4])&&(c[1]==c[3])) ans++;

  }

  cout<<ans<<endl;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int main(){

  int a,b;

  scanf("%d%d",&a,&b);

  int r=0;

  for(int i=a;i<=b;i++){

    int s=i%10,t=i/10000%10;

    int u=i/10%10,v=i/1000%10;

    if(s==t&&u==v)r++;

  }

  printf("%d\n",r);

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std ;



#define sz(v) (int)v.size()

#define ll long long

#define all(v)  v.begin() , v.end()

#define rall(v)  v.rbegin() , v.rend()

#define pf push_front

#define pb push_back

#define fast FastInputOutput() ;

#define Clear( container , value ) memset( container , value , sizeof container )

#define PI acos( -1.0 )

#define forn( t , v , be , n ) for( t v = be ; v < n ; v++ )

#define fore( x , j ) for( auto x : j )

#define se second

#define fr first

//#define c_b fflush(stdin);



const ll Long_max = numeric_limits < ll > :: max() ;

const int Int_max = numeric_limits < int > :: max() ;



void File_input( string pathIn ) {

    freopen( pathIn.c_str(), "r", stdin ) ;

}



void File_output( string pathOut ) {

    freopen( pathOut.c_str(), "w", stdout ) ;

}



int msg() {

    srand( time( 0 ) ) ;

    vector < string > st = {

        "Wish everyone high ratings!",

        "Good luck!",

        "Have fun!",

        "Please, read all the problems!",

        "Go Go fight!"

    } ;

    cerr << st[ rand() % sz( st ) ] ;

    return 0 ;

}



void FastInputOutput() {

    ios_base :: sync_with_stdio( 0 ) ;

    cin.tie( 0 ) ;

    cout.tie( 0 ) ;

}



int a , b ;

bool is(int c ){

int rev = 0 , t = c ;

while( c ){

    rev = rev * 10 + c % 10 ;

    c /= 10 ;

}

return rev == t ;

}



int main() {

   cin >> a >> b ;

   int cn = 0 ;

   forn( int , i , a , b + 1 ){

     cn += is( i ) ;

   }

   cout << cn ;

   return 0 ;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int hws(int x)

{

    int num=0;

    while(x)

    {

        num*=10;

        num+=x%10;

        x=x/10;

    }

    return num;

}

int main()

{

    int a,b;

    scanf("%d %d",&a,&b);

    int sum=0;

    for(int i=a;i<=b;i++)

    {

        if(i==hws(i))

            sum++;

    }

    printf("%d\n",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



vector<int> v;



int main(){



    int a, b;

    scanf("%d%d", &a, &b);

    int cnt=0;



    for(int i=a; i<=b; ++i){

        v.clear();

        int num=i;

        while(num){

            v.push_back(num%10);

            num/=10;

        }

        int sz=v.size();

        bool pal=true;

        for(int i=0, j=sz-1; i<j ; ++i, --j){

            if(v[i]!=v[j])

                pal=false;

        }

        if(pal)

            ++cnt;

    }



    printf("%d\n", cnt);

















    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int hws(int x)

{

    int num=0;

    while(x)

    {

        num*=10;

        num+=x%10;

        x=x/10;

    }

    return num;

}

int main()

{

    int a,b;

    scanf("%d %d",&a,&b);

    int sum=0;

    for(int i=a;i<=b;i++)

    {

        if(i==hws(i))

            sum++;

    }

    printf("%d\n",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
//

// Created by mustafa on 17/07/19.

//

#pragma GCC optimize("O3")

#include<bits/stdc++.h>

using namespace std ;



#define ll long long

#define submitStage int TCF = 1 ;

#define testStage int TCF = 1000 ;

#define all(v)  v.begin() , v.end()

#define Start while(TCF--)

#define FOR(i, a, b) for (int i = (a); i < (b); i++)

#define FORd(i, a, b) for (int i = (a); i >= (b); i--)

#define REP(i, n) FOR(i, 0, n)

#define FastInputOutput ios_base :: sync_with_stdio( 0 ) ; cin.tie( 0 ) ; cout.tie( 0 ) ;

#define ReadFromFile(x)  freopen( x, "rt" , stdin ) ;

#define WriteToFile(x)  freopen( "in.txt", "wt" , stdout ) ;

#define D(x) scanf("%d",&x);

#define LLD(X) scanf("%lld",&x);

#define in(x,...) scanf(x,__VA_ARGS__)

#define out(x,...) printf(x,__VA_ARGS__)

/// for debugging

string to_string(string s) {return '"' + s + '"';}string to_string(const char* s) {return to_string((string) s);}string to_string(bool b) {return (b ? "true" : "false");}template <typename A, typename B>string to_string(pair<A, B> p) {return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}template <typename A>string to_string(A v) {bool first = true;string res = "{";for (const auto &x : v) {if (!first) {res += ", ";}first = false;res += to_string(x);}res += "}";return res;}void debug_out() { cerr << endl; }template <typename Head, typename... Tail>void debug_out(Head H, Tail... T) {cerr << " " << to_string(H);debug_out(T...);}

#ifndef ONLINE_JUDGE

#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

#else

#define dbg(...) {}

#endif



/// start driven program

const int N=1e6+7  , MOD= 1e9+7;



int mod(int k, int n){

    return((k %= n) < 0) ? k+n : k;

}

bool isP(int num){

    int ret=0;

    int temp=num;

    while(num){

        int m=num%10;

        ret=ret*10 + m;

        num/=10;

    }

    return (temp==ret);

}



int main(){

    submitStage Start {

        int n,m;

        D(n)   D(m)

        int cnt=0;

        FOR(i,n,m+1){

            cnt+= isP(i);

        }

        printf("%d\n",cnt);

    }

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

int hws(int x)

{

    int num=0;

    while(x)

    {

        num*=10;

        num+=x%10;

        x=x/10;

    }

    return num;

}

int main()

{

    int a,b;

    scanf("%d %d",&a,&b);

    int sum=0;

    for(int i=a;i<=b;i++)

    {

        if(i==hws(i))

            sum++;

    }

    printf("%d\n",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;





const int N=1e6,OO = 0x3f3f3f3f;

int d()

{

    int ret;

    scanf("%d", &ret);

    return ret;

}

long long lld()

{

    long long ret;

    scanf("%lld", &ret);

    return ret;

}

bool isplaind(int n){

    string s=to_string(n);

    string s1="";

    for(int i=s.length()-1;i>=0;i--)

        s1+=s[i];

    return (s==s1);

}

int main(){

    int a=d(),b=d();

    int ans=0;

    for(int i=a;i<=b;i++)

    if(isplaind(i))ans++;

    printf("%d\n",ans);

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int hws(int x)

{

    int num=0;

    while(x)

    {

        num*=10;

        num+=x%10;

        x=x/10;

    }

    return num;

}

int main()

{

    int a,b;

    scanf("%d %d",&a,&b);

    int sum=0;

    for(int i=a;i<=b;i++)

    {

        if(i==hws(i))

            sum++;

    }

    printf("%d\n",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std ;

#define ll long long

void FastInputOutput(){

    ios_base :: sync_with_stdio( 0 ) ;

    cin.tie( 0 ) ;

    cout.tie( 0 ) ;

}



inline int D(){

    int t ;

    scanf( "%d" , &t ) ;

    return t ;

}

inline ll LLD(){

    ll t ;

    scanf( "%lld" , &t ) ;

    return t ;

}



ll power(ll x, ll p, ll m){

    ll res = 1;

    while(p){

        if(p&1)    res = (res * x)%m;

        x = (x * x)%m;

        p >>= 1;

    }

    return res;

}

long double ModLog(long double base, long double x) {

    return (logl(x) / logl(base));

}



const int N = 2e6 + 5, MX = 1e9;

char a[N];

int rev(int n){

    int ret = 0;

    while (n) {

        ret = ret * 10 + n % 10;

        n /= 10;

    }

    return ret;

}

int main(){

    int a = D(), b = D(), ans = 0;

    for(int i = a; i <= b; ++i){

        ans += rev(i) == i;

    }

    printf("%d", ans);

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int hws(int x)

{

    int num=0;

    while(x)

    {

        num*=10;

        num+=x%10;

        x=x/10;

    }

    return num;

}

int main()

{

    int a,b;

    scanf("%d %d",&a,&b);

    int sum=0;

    for(int i=a;i<=b;i++)

    {

        if(i==hws(i))

            sum++;

    }

    printf("%d\n",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <stdio.h>

#include <string.h>

#include <iostream>

#include <algorithm>

#include <math.h>

#include <limits.h>

#include <map>

#include <stack>

#include <queue>

#include <vector>

#include <set>

#include <string>

using namespace std;

#define ll long long

const int maxx = 100005;

int ans[maxx];

int solve(int x)

{

    int k = 10000,cnt = 0,y = x;

    while(y){

        int now = y%10;

        y /= 10;

        cnt += now*k;

        k /= 10;

    }

    //cout<<cnt<<endl;

    if(cnt == x){

        return 1;

    }

    return 0;

}

int main()

{

    int x,y,cnt = 0;

    cin>>x>>y;

    for(int i=x;i<=y;i++){

        if(solve(i)){

            cnt++;

        }

    }

    cout<<cnt<<endl;

    //cout<<ans[y] - ans[x]<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int hws(int x)

{

    int num=0;

    while(x)

    {

        num*=10;

        num+=x%10;

        x=x/10;

    }

    return num;

}

int main()

{

    int a,b;

    scanf("%d %d",&a,&b);

    int sum=0;

    for(int i=a;i<=b;i++)

    {

        if(i==hws(i))

            sum++;

    }

    printf("%d\n",sum);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <cstdio>

#include <cmath>

#include <string>

#include <cstring>

#include <algorithm>

#include <iomanip>

#include <cstdlib>

#include <cctype>

#define ll long long

#define PI 3.14159265358979323846

using namespace std;

const int maxn = 1e6+7;



int main(){

	ll a,b;

	cin>>a>>b;

	ll temp;ll jw=10000;

	ll tempa;

	ll cnt=0;

	for(ll i=a;i<=b;i++){

		temp=0;

		tempa=i;

		jw=10000;

		while(jw!=0){

			temp+=(tempa%10*jw);

			jw/=10;

			tempa/=10;

		}

		if(temp==i){

			cnt++;

		}

	}

	cout<<cnt<<endl;

	return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>

int hws(int x)

{

    int num=0;

    while(x)

    {

        num*=10;

        num+=x%10;

        x=x/10;

    }

    return num;

}

int main()

{

    int a,b;

    scanf("%d %d",&a,&b);

    int sum=0;

    for(int i=a;i<=b;i++)

    {

        if(i==hws(i))

            sum++;

    }

    printf("%d\n",sum);

    return 0;

}


// Fastest known solution for this problem: