#include<bits/stdc++.h>
using namespace std;

long long sd(int a, int b, int p){
	if(a != b){
		cerr << max(a, b) * pow(10, p) << endl;
		return max(a, b) * pow(10, p);
	}
	cerr <<	(a + 10*a) * pow(10, p) << endl;
	return (a + 10*a) * pow(10, p);
	
}

int main(){
	long long x, y;
	cin >> x >> y;
	//X i Y u CIFRE
	int xc[10], yc[10];
	int i = 0;
	while(x / 10 != 0){
		xc[i] = x % 10;
		x /= 10;
		i++;
	}
	xc[i] = x % 10;

	int j = 0;
	while(y / 10 != 0){
		yc[j] = y % 10;
		y /= 10;
		j++;
	}
	yc[j] = y % 10;
	//reverse(yc, yc + j + 1);
	//reverse(xc, xc + i + 1);
	for(int f = i + 1; f < 10; f++) xc[f] = -1;
	for(int f = j + 1; f < 10; f++) yc[f] = -1;
	
	
	// SUDARANJE	
	int ln = max(j, i);
	unsigned long long r = 0;
	int m = 0;
	for(int f = 0; f <= ln; f++){
		if(xc[f] != yc[f]){
			r += sd(xc[f], yc[f], f + m);
		}
		else{
			r += sd(xc[f], yc[f], f + m);
			m++;
		}
	}
	cout << r << endl;
	
	return 0;
}