var a,s: integer;
begin
readln(a);
s:=0;
while a>0 do
if a mod 10>5 then s:=s+a mod 10;
a:=a div 10;
end;
writeln(s);
end.
var a,s: integer;
begin
readln(a);
s:=0;
while a>0 do
begin
if a mod 10>5 then s:=s+a mod 10;
a:=a div 10;
end;
writeln(s);
end.