CONST
N = 3;
VAR
num: REAL;
p, k, i, s: INTEGER;
nStr, kStr: STRING;
BEGIN
readln(num);
Str(num, nStr);
p:= Pos('.', nStr);
kStr:= copy(nStr, p + 1, N);
k:= StrToInt(kStr);
s:= 0;
WHILE (k <> 0) DO
BEGIN
s:= s + (k mod 10);
k:= k div 10;
END;
writeln(s);
END.