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

using namespace std;

int main()

{

    int R,a;

    cin>>R;

    a=R*R;

    cout<<a;

}






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

int main()

{

    int r,p;



    scanf("%d",&r);



    p = (r * r);



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



    return 0;

}


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

using namespace std;

int main()

{

int r;

cin>>r;

cout<<r*r<<endl;



return 0;







}




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

int main()

{

    int r,p;



    scanf("%d",&r);



    p = (r * r);



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



    return 0;

}


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

using namespace std;

#define ll long long 

#define mod 1000000007

#define first f

#define second s

#define N 1000000

vector<ll>v(N);

ll l,m,n,sum,ans,maximum,minimum,mahakal,a,b,c,t,i,j,k;

ll cnt,cnt1,cnt2,cnt3;

string str,str1;

ll arr[N];

int main(){

    cin>>n;

  cout<<n*n<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
/*   ꧁༒☬महाकाल☬༒꧂ ꧁༒ঔमहाकालঔ༒꧂

                   

                   ঔৣ۝महाकालᴳᵒᵈ۝ঔৣ            

 

 */ 

#include<bits/stdc++.h>

using namespace std;

//#include <ext/pb_ds/assoc_container.hpp>

//#include <ext/pb_ds/tree_policy.hpp>

//using namespace __gnu_pbds;

//template <typename T, typename cmp=less<T>> using oset =tree<T, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;

#define ll long long 

#define mod 1000000007

#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

#define _it iterator

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

#define f first

#define s second

#define pb push_back

void mahakal(){

	#ifndef ONLINE_JUDGE

	freopen("input.txt","r",stdin);

	freopen("output.txt","w",stdout);

	freopen("error.txt","w",stderr);

	#endif

}

int main(){

	//mahakal(),fast;

	

	ll r ;

	cin>> r ;

	ll ans = r*r ;

	cout<<ans<<endl;



	return 0;

}

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



using namespace std ;



int main()



{

    int r ;



    cin>>r ;



    cout<<r*r<<endl ;



    return 0;

}

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

int main()

{

   int r,result;

   scanf("%d",&r);

   result=r*r;

   printf("%d",result);

   return 0;

}


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

using namespace std;

int main()

{

    int r;

    cin>>r;

    cout<<r*r<<endl;

    return 0;

}


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

int main() {

	int r;

	scanf("%d",&r);

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

	return 0;

}

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

using namespace std;



int a[100001];

int N, i, cnt;

main(){

    cin >> N;

    for(; i<N; i++) cin >> a[i];

    for(int i = 0; i < N; i++){

        if(a[a[i] - 1] - 1 == i){

            cnt++;

        }

    }

    cout << cnt / 2 << endl;

    return 0;

}


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

int a[100010],b,i,s;main(){scanf("%d",&b);for(;i-b;++i)scanf("%d",a+i+1);for(i=1;i<=b;++i){i==a[a[i]]?++s:0;}printf("%d\n",s/2);}

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

#include<string.h>

#include<cstdio>

#include<algorithm>

#include<stack>

#include<queue>

#include<vector>

#include<cmath>

#include<utility>

#define ll long long int

#define ld long double

#define INF 1000000000

#define EPS 0.0000000001

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

using namespace std;

typedef pair<int, int> P;



string str;



int main()

{

  int n,i;

  int a[1000000];

  bool p[1000000];





  cin>>n;

  p[0]=false;



  for(i=1;i<=n;i++){

    cin>>a[i];

    p[i]=false;

  }



  for(i=1;i<=n;i++){

    if(a[a[i]]==i){

      p[i]=true;

      p[a[i]]=true;

    }

  }

  int ans=0;

  for(i=1;i<=n;i++)

    if(p[i])

      ans++;

  cout<<ans/2<<endl;

}


// Optimized solution to the same problem (faster):
#include<iostream>

#include<algorithm>

#include<cstdio>

#include<cmath>

#include<math.h>

#include<string>

#include<string.h>

#include<stack>

#include<queue>

#include<vector>

#include<utility>

#include<set>

#include<map>

#include<stdlib.h>

#include<iomanip>



using namespace std;



#define ll long long

#define ld long double

#define EPS 0.0000000001

#define INF 1e9

#define MOD 1000000007

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

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

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

#define shosu(x) fixed<<setprecision(x)



typedef vector<int> vi;

typedef pair<int,int> pii;



int main(void) {

  int i,j;

  int n;

  cin>>n;

  vi a(n);

  rep(i,n)cin>>a[i],a[i]--;

  int ans=0;

  rep(i,n)if(a[a[i]]==i)ans++;

  cout<<ans/2<<endl;

}


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

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

#define EPS (1e-10)

#define MOD 1000000007

#define INF 0x3f3f3f3f

using namespace std;

typedef long long ll;

typedef pair<int, int>P;



int s[100000];

int main() {

	int n; scanf("%d", &n);

	int cnt = 0;

	for(int i=1;i<=n;i++) {

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

		if (s[a] == i)cnt++;

		s[i] = a;

	}

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

}

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



int s[100001];

int main() {

	int n; scanf("%d", &n);

	int cnt = 0;

	for (int i = 1; i <= n; i++) {

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

		if (s[a] == i)cnt++;

		s[i] = a;

	}

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

}

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

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



int s[100001];

int main() {

	int n; scanf("%d", &n);

	int cnt = 0;

	for (int i = 1; i <= n; i++) {

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

		if (s[a] == i)cnt++;

		s[i] = a;

	}

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

}

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



int s[100001];

int main() {

	int n; scanf("%d", &n);

	int cnt = 0;

	for (int i = 1; i <= n; i++) {

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

		if (s[a] == i)cnt++;

		s[i] = a;

	}

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

}

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

#include<cstring>

#define maxn 10000

using namespace std;



int bcj[maxn + 100], n, m;



int Find(int x){

	if(bcj[x] < 0)

		return x;

	return bcj[x] = Find(bcj[x]);

}



void Union(int x, int y){

	x = Find(x);

	y = Find(y);

	if(x == y)

		return;

	bcj[x] += bcj[y];

	bcj[y] = x;

}



int main(){

	cin >> n >> m;

	int choice, x, y;

	memset(bcj, -1, sizeof(bcj));

	for(int i = 0; i < m; i++){

		cin >> choice >> x >> y;

		if(choice == 0){

			Union(x, y);

		}

		else{	

			cout << (Find(x) == Find(y)) << endl;

		}

	}

	return 0;

}


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

#include <vector>



class DisjointSet

{

public:

	DisjointSet(int n)

	{

		p.resize(n, 0);

		rank.resize(n, 0);

		for (int i = 0; i < n; i++)

			MakeSet(i);

	}



	void MakeSet(int x)

	{

		p[x] = x;

		rank[x] = 0;

	}



	bool Same(int x, int y)

	{

		return FindSet(x) == FindSet(y);

	}



	int FindSet(int x)

	{

		if (p[x] != x)

			p[x] = FindSet(p[x]);

		return p[x];

	}



	void Unit(int x, int y)

	{

		Link(FindSet(x), FindSet(y));

	}



	void Link(int x, int y)

	{

		if (rank[x] > rank[y])

			p[y] = x;

		else

		{

			p[x] = y;

			if (rank[x] == rank[y])

				rank[y]++;

		}

	}



private:

	std::vector<int> p, rank;

};



int main()

{

	int n, q, c, x, y;

	scanf("%d%d", &n, &q);

	DisjointSet ds(n);



	for (int i = 0; i < q; i++)

	{

		scanf("%d%d%d", &c, &x, &y);

		//printf("T %d %d %d\n", c, x, y);

		if (c == 0)

			ds.Unit(x, y);

		else

			printf("%d\n", ds.Same(x, y) ? 1 : 0);

	}



	return 0;

}




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

#include <cstdio>

#include <cstring>

#include <cstdlib>

#include <cmath>

#include <vector>

#include <string>

#include <map>

#include <set>

#include <queue>

#include <stack>

#include <algorithm>



using namespace std;



#define rep(i,j) REP((i), 0, (j))

#define REP(i,j,k) for(int i=(j);(i)<(k);++i)

#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))

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

#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))

#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)

#define SQ(x) ((x)*(x))

#define Mod(x, mod) (((x)+(mod)%(mod))

#define MP make_pair

#define PB push_back

#define F first

#define S second

#define INF 1 << 30

#define EPS 1e-10

#define MOD 1000000007



typedef pair<int, int> pi;

typedef pair<int, pi> pii;

typedef vector<int> vi;

typedef queue<int> qi;

typedef long long ll;



struct UF{

  int par[10001];

  int rank[10001];



  UF(int n){ init(n); }

  void init(int n){

    for(int i=0;i<n;i++){

      par[i] = i;

      rank[i] = 0;

    }

  }



  int find(int x){

    if(par[x] == x) return x;

    else return par[x] = find(par[x]);

  }



  void unite(int x, int y){

    x = find(x);

    y = find(y);

    if(x == y) return;

    if(rank[x] < rank[y]){

      par[x] = y;

    }else{

      par[y] = x;

      if(rank[x] == rank[y]) rank[x]++;

    }

  }



  int same(int x,int y){

    return find(x) == find(y);

  }

};



int main(){

  int n ,q;

  scanf("%d%d", &n, &q);

  UF uf(n);



  rep(i, q){

    int com, x, y;

    scanf("%d%d%d", &com, &x, &y);

    if(com){

      printf("%d\n", uf.same(x, y)?1:0);

    }else{

      uf.unite(x, y);

    }

  }

  

  return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstring>

#include <algorithm>



using namespace std;



struct UnionFind{

  int par[10005];

  int rank[10005];

  UnionFind(int n){ init(n);}

  void init(int n){

    for(int i=0;i<n;i++){

      par[i] = i;

      rank[i] = 0;

    }

  }

  int find(int x){

    if(x == par[x]) return x;

    return par[x] = find(par[x]);

  }

  int same(int x, int y){

    return find(x) == find(y);

  }

  void unite(int x, int y){

    x = find(x); y = find(y);

    if(x==y) return;

    if(rank[x] < rank[y]){

      par[x] = y;

    }else{

      par[y] = x;

      if(rank[x] == rank[y]) rank[x]++;

    }

  }

};



int main(){

  int n,q;

  scanf("%d%d",&n,&q);

  UnionFind uf(n);

  while(q--){

    int com, x,y;

    scanf("%d%d%d",&com,&x,&y);

    if(com) printf("%d\n", uf.same(x,y));

    else uf.unite(x,y);

  }

  return 0;

}

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

#include <iostream>

using namespace std;

int n, q, com, x, y; int group[10000]; vector<int> f[10000];

int main() {

	scanf("%d%d", &n, &q);

	for(int i = 0; i < n; i++) group[i] = i, f[i].push_back(i);

	for(int i = 0; i < q; i++) {

		scanf("%d%d%d", &com, &x, &y);

		if(com == 0) {

			if(group[x] == group[y]) continue;

			x = group[x], y = group[y];

			if(f[x].size() > f[y].size()) {

				for(int j = f[y].size() - 1; j >= 0; j--) {

					group[f[y][j]] = group[x];

					f[x].push_back(f[y][j]);

					f[y].pop_back();

				}

			}

			else {

				for(int j = f[x].size() - 1; j >= 0; j--) {

					group[f[x][j]] = group[y];

					f[y].push_back(f[x][j]);

					f[x].pop_back();

				}

			}

		}

		else {

			printf("%d\n", (group[x] == group[y] ? 1 : 0));

		}

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <vector>

#include <numeric>

#include <algorithm>



class unionfind {

private:

	int size_;

	std::vector<int> parent;

	std::vector<int> rank;

public:

	unionfind() : size_(0), parent(std::vector<int>()), rank(std::vector<int>()) {};

	unionfind(int size__) : size_(size__), parent(std::vector<int>(size_)), rank(std::vector<int>(size_, 0)) {

		std::iota(parent.begin(), parent.end(), 0);

	}

	int size() { return size_; }

	int root(int x) {

		if (parent[x] == x) return x;

		return parent[x] = root(parent[x]);

	}

	bool same(int x, int y) {

		return root(x) == root(y);

	}

	void unite(int x, int y) {

		x = root(x); y = root(y);

		if (x == y) return;

		if (rank[x] < rank[y]) parent[x] = y;

		else if (rank[x] > rank[y]) parent[y] = x;

		else parent[y] = x, rank[x]++;

	}

};



#include <cstdio>

int N, Q, tp, x, y;

int main() {

	scanf("%d%d", &N, &Q);

	unionfind uf(N);

	while (Q--) {

		scanf("%d%d%d", &tp, &x, &y);

		if (tp == 0) uf.unite(x, y);

		else printf("%d\n", uf.same(x, y));

	}

	return 0;

}

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

#include <iostream>

using namespace std;

int n, q, com, x, y; int group[10000]; vector<int> f[10000];

int main() {

	scanf("%d%d", &n, &q);

	for(int i = 0; i < n; i++) group[i] = i, f[i].push_back(i);

	for(int i = 0; i < q; i++) {

		scanf("%d%d%d", &com, &x, &y);

		if(com == 0) {

			if(group[x] == group[y]) continue;

			x = group[x], y = group[y];

			if(f[y].size() > f[x].size()) swap(x, y);

			for(int j = f[y].size() - 1; j >= 0; j--) {

				group[f[y][j]] = group[x];

				f[x].push_back(f[y][j]);

				f[y].pop_back();

			}

		}

		else printf("%d\n", (group[x] == group[y] ? 1 : 0));

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <vector>

#include <numeric>

#include <algorithm>



class unionfind {

private:

	int size_;

	std::vector<int> parent;

	std::vector<int> rank;

public:

	unionfind() : size_(0), parent(std::vector<int>()), rank(std::vector<int>()) {};

	unionfind(int size__) : size_(size__), parent(std::vector<int>(size_)), rank(std::vector<int>(size_, 0)) {

		std::iota(parent.begin(), parent.end(), 0);

	}

	int size() { return size_; }

	int root(int x) {

		if (parent[x] == x) return x;

		return parent[x] = root(parent[x]);

	}

	bool same(int x, int y) {

		return root(x) == root(y);

	}

	void unite(int x, int y) {

		x = root(x); y = root(y);

		if (x == y) return;

		if (rank[x] < rank[y]) parent[x] = y;

		else if (rank[x] > rank[y]) parent[y] = x;

		else parent[y] = x, rank[x]++;

	}

};



#include <cstdio>

int N, Q, tp, x, y;

int main() {

	scanf("%d%d", &N, &Q);

	unionfind uf(N);

	while (Q--) {

		scanf("%d%d%d", &tp, &x, &y);

		if (tp == 0) uf.unite(x, y);

		else printf("%d\n", uf.same(x, y));

	}

	return 0;

}

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

#include <vector>

using namespace std;



vector<int> l[10000];

int s[10000];

int n;



void unite(int x, int y){

    if(s[x]==s[y])return;



    int i,j,tmp;

    int sx = s[x];

    int sy = s[y];

    for(i=0;i<l[sy].size();i++){

        tmp = l[sy][i];

        s[tmp] = sx;

        l[sx].push_back(tmp);

    }

    l[sy].clear();

    return;

}



bool same(int x, int y){

    return s[x]==s[y];

}



int main(){

    int i,q,com,x,y;

    scanf("%d %d",&n,&q);

    for(i=0;i<n;i++){

        s[i]=i;

        l[i].push_back(i);

    }

    for(i=0;i<q;i++){

        scanf("%d %d %d",&com,&x,&y);

        if(com==0)unite(x,y);

        else{

            if(same(x,y))printf("1\n");

            else printf("0\n");

        }

    }

    return 0;

}




// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cstdlib>



typedef struct node_{

    int key;

    int height;

    struct node_ *parent;

}node;



node *nd;



node* top(node* nd){

    while(true){

        if(nd->parent==NULL)break;

        nd = nd->parent;

    }

    return nd;

}



void unite(int x, int y){

    node* a = top(nd+x);

    node* b = top(nd+y);

    if(a==b)return;

    if(a->height < b->height){

        a->parent = b;

    }else{

        b->parent = a;

        if(a->height == b->height){

            a->height++;

        }

    }

    return;

}



int same(int x, int y){

    node* a = top(nd+x);

    node* b = top(nd+y);

    if(a==b)return 1;

    else return 0;

}



int main(){

    int i,n,q,x,y,com;

    scanf("%d %d",&n,&q);

    nd = (node *)malloc(sizeof(node)*n);



    for(i=0;i<n;i++){

        nd[i].key = i;

        nd[i].height = 1;

        nd[i].parent = NULL;

    }



    for(i=0;i<q;i++){

        scanf("%d %d %d",&com,&x,&y);

        switch(com){

        case 0://unite

            unite(x,y);

            break;

        case 1://same

            printf("%d\n",same(x,y));

            break;

        default:

            perror("error\n");

            return -1;

            break;

        }

    }

    return 0;

}




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

using namespace std;

int main()

{

    int i,p,j,n,k,q,m;

    int x=0;

    int a,b;

    cin>>a>>b;

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

   {



       n=i;m=i;q=0;

       while(n>0)

       {

           p=n%10;

           q=q*10+p;

           n=n/10;

       }

       if(n>0)

       {

           q=q*10+n;

       }



       if(q==m)

        x++;



    }

    cout<<x<<endl;



 return 0;

}


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

int main()

{

    int m,n,a[10],i,k=0;

    scanf("%d %d",&m,&n);

    for(i=m;i<=n;i++)

    {

        a[0]=i/10000;

        a[1]=i%10000/1000;

        a[2]=i%10000%1000/100;

        a[3]=i%100/10;

        a[4]=i%10;

        if(a[0]==a[4]&&a[1]==a[3])

            k++;

    }

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



    return 0;

}


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

#include <bits/stdc++.h>

typedef long long ll ;

#define pb push_back

#define f first

#define s second

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

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

#define SZ(a) (int)a.size()

#define Flush fflush(stdout);

using namespace std ;

bool pal (int x )

{

    int t[20];

    int id =0 ;

    while (x)

    {

        t[id++] = x %10 ;

        x/=10;

    }

    id--;

    int i =0 ;

    while (i < id )

    {

        if (t[i] != t[id])return false ;

        i++; id--;

    }

    return true ;

}

int main()

{

    int a, b ;

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

    int ans =0 ;

    while (a <= b )

    {

        ans += pal(a);

        a++;

    }

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



}


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

int main()

{

    int m,n,a[10],i,k=0;

    scanf("%d %d",&m,&n);

    for(i=m;i<=n;i++)

    {

        a[0]=i/10000;

        a[1]=i%10000/1000;

        a[2]=i%10000%1000/100;

        a[3]=i%100/10;

        a[4]=i%10;

        if(a[0]==a[4]&&a[1]==a[3])

            k++;

    }

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



    return 0;

}


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



using namespace std;

#define ll long long

const int MAX =1e5+9;











int main ()

{



    int n , m , ans=0;

    cin>>n>>m;

    for ( int i = n ;i<=m ;i++)

    {



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

                ans++;

    }

    cout<<ans;

}


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

int main()

{

    int m,n,a[10],i,k=0;

    scanf("%d %d",&m,&n);

    for(i=m;i<=n;i++)

    {

        a[0]=i/10000;

        a[1]=i%10000/1000;

        a[2]=i%10000%1000/100;

        a[3]=i%100/10;

        a[4]=i%10;

        if(a[0]==a[4]&&a[1]==a[3])

            k++;

    }

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



    return 0;

}


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

#include<string>

#include<cstring>

#include<algorithm>

#include<vector>

#include<cmath>

#include<map>

#include<set>

#include<cstdio>

#define MAXA 100000

#define MAX 20000000000

#define s(i) scanf("%d", &(i))

#define p(i) printf("%d", (i))

#define ps() printf(" ") 

#define rer(i,j,k) for((i)=(j);(i)<(k);++(i))

#define ret(i,j,k) for((i)=(j);(i)>(k);--(i))

using namespace std;

int a1[MAXA] = {0}, a2[MAXA] = {0};

int main(){

	int a, b, c, i, j;

	int Count = 0;

	cin >> a >> b;

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

		int t = 0, is = 0, q;

		q = i;

		while(q){

			a1[t++] = q%10;

			q/=10;

		}

		for(j = 0; j < (t+1)/2; j++){

			if(a1[j]!=a1[t-1-j]){

				is = 1;

				break;

			}

		}

		if(!is){

			Count++;

		}

		memset(a1,0,sizeof(a1));

	}

	cout << Count << endl;

	return 0;

}

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

#include<string.h>

void hws(int a,int b)

{

    int i,l=0,s=0,t=0,dzs=0;

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

    {

        t=i;

        dzs=0;

        while(t!=0)

        {

            l=t%10;

            t=t/10;

            dzs=dzs*10+l;

            if(i==dzs)

                s++;



        }

    }

    printf("%d",s);

}

int main()

{

    int a,b;

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

    hws(a,b);

    return 0;

}


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

#include<string.h>

#include<algorithm>

#include<iostream>

#include<math.h>

#define ll long long

using namespace std;



int JUDGE(int n)

{

    int a;

	a=0;

	while(n>0)

	{

		a=a*10+n%10;

		n=n/10;

	}

	return a;

}

int main()

{

    int a,b;

    while(~scanf("%d%d",&a,&b))

    {

        int m, sum=0;

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

        {



           m=JUDGE(i);

            if(m==i)

                sum++;



        }

        cout<<sum<<endl;



    }

    return 0;

}


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

int acm(int n)

{

    int rest=0;

    int ans=n;

    while(n!=0)

    {

       rest*=10;

       rest+=n%10;

       n/=10;

    }

    if(rest==ans)

        return 1;

    return 0;

}

int main()

{

    int a,b;

    int flag=0;

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

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

    {

        if(acm(i)==1)

            flag++;

    }

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

    return 0;

}


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

#include<iostream>

using namespace std;

int a,b,ans;

int main()

{

    cin>>a>>b;

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

    {

        int x=i/10000,y=i/1000%10;

        if(x==i%10&&y==i/10%10)

            ans++;

    }

    cout<<ans;

}

// Optimized solution to the same problem (faster):
/*Lucky_Glass*/

#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

int main()

{

	int A,B;

	scanf("%d%d",&A,&B);

	int ans=0;

	for(int i=100;i<=999;i++)

	{

		int n=i*100+i/10%10*10+i/100;

		if(A<=n && n<=B) ans++;

	}

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

	return 0;

}


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

using namespace std;

int main()

{

    int A,B,i,p,p1,q,q1,r,r1,s,s1,t,t1;

    int flag=0;

    cin>>A>>B;

    for(i=A;i<=B;i++)

    {

         p=i%10;

         p1=i/10;

         q=p1%10;

         q1=p1/10;

         r=q1%10;

         r1=q1/10;

         s=r1%10;

         s1=r1/10;

        t=s1%10;

         t1=s1/10;

         if(t==p && q==s)

         {

             flag++;

         }





    }





    cout<<flag<<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: