using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;



namespace djf
{
    class Program
    {



        static void Main(string[] args)
        {
            List<long> l = new List<long>();
            List<long> l1 = new List<long>();
            List<bool> l2 = new List<bool>();
            long x= Convert.ToInt64(Console.ReadLine());
            long y= Convert.ToInt64(Console.ReadLine());
            long broj=0;
            long d = 1;
         
            while (x > 0)
            {
                l.Add(x % 10);
                x /= 10;
            }
            while (y > 0)
            {
                l1.Add(y % 10);
                y /= 10;
            }
        

            if (l1.Count != l.Count)
            {
                if (l.Count > l1.Count)
                {
                    for(int i = 0; i < l1.Count; i++)
                    {
                        l2.Insert(i, false);
                       

                    }
                    for (int i = l1.Count; i < l.Count; i++)
                    {
                        l2.Insert(i, true);
                        l1.Add(0);
                    }

                }
                else
                {
                    for (int i = 0; i < l.Count; i++)
                    {
                        l2.Insert(i, false);


                    }
                    for (int i = l.Count; i < l1.Count; i++)
                    {
                        l2.Insert(i, true);
                        l.Add( 0);
                    }
                }

            }
            l.Reverse();
            l1.Reverse();

            for (int i = l1.Count-1; i >= 0; i--)
                {
                if (l[i] > l1[i])
                {
                    long p = l[i] * d;
                    broj += p;
                    d *= 10;
                }
                else if (l1[i]>l[i])
                    {
                        long p = l1[i] * d;
                        broj += p;
                        d *= 10;
                    }
                else
                {
                    if (l1[i] == 0)
                    {
                        if (l2[i] == true)
                        {
                            long p1 = l1[i] * d;
                            broj += p1;
                            d *= 10;
                        }
                    }
                    else if (l[i] == 0)
                    {
                        if (l2[i] == true)
                        {
                            long p1 = l1[i] * d;
                            broj += p1;
                            d *= 10;
                        }
                    }
                    else
                    {
                        long p = l1[i] * d;
                        d *= 10;
                        long q = l1[i] * d;
                        broj += q;
                        broj += p;
                        d *= 10;
                    }
                }
                }
            
            Console.WriteLine(broj);

            Console.ReadKey();

        }
    }
}