var
a:array[0..9] of integer;
cif:set of char;
s:string;
i,n,max:integer;
begin
read(s);
cif:=['0'..'9'];
for i:=1 to length(s) do
if(s[i] in cif) then
a[ord(s[i])-48]+=1;
for i:=0 to 9 do
if(a[i]>max) then
begin
max:=a[i];
n:=i;
end;
if(max=0) then
writeln('NU')
else
writeln(n);
end.