var a,sum:integer;
begin
read(a);
while(a<>0)do begin
if(a mod 4=0)and(a>99)and(a<1000)then sum:=sum+a;
end;
write(sum);
end.
(1 < 17) V (1 < 16)
1 V 1 = 1