var a,b,n,sum: longint;
begin
read (n);
b:= n mod 10;
while n>0 do
begin
if n div 10 = 0 then
a:= n mod 10;
sum:= sum + (n mod 10);
n:= n div 10;
end;
writeln (sum);
if a = b then
write ('First digit = Last Digit')
else
write ('First digit <> Last Digit');
end.