#include <iostream>
#include <fstream>
using namespace std;
ifstream f("date.txt");
ofstream g("out.txt");
int main()
{
int a,b,s=0;
f>>a>>b;
f.close();
if (a>b)
{
while (a!=0)
{
s=s+a%10;
a=a/10;
}
g<<s;
}
else
{
while (b!=0)
{
s=s+b%10;
b=b/10;
}
g<<s;
}
g.close();
return 0;
}