uses crt;
var n,x,y,d,i,t:integer;
st:string;
begin
clrscr;
write('nhap n='); readln(n);
str(n,st);
d:=length(st);
t:=0;
for i:=1 to d do
begin
val(st[i],x,y);
t:=t+x;
end;
writeln(t);
readln;
end.
var s:ansistring;k,tam:longint;
begin
readln(s);
while length(s)<>0 do
begin
val(s[1],tam);
k:=k+tam;
delete(s,1,1);
end;
write(k);
readln
end.