Program num1;
Uses crt;
Var
a :array [1..100] of integer;
i,k,n, s : integer;
Begin
clrscr;
s:=0;
write('K=');readln(k);
write('N=');readln(n);
for i:=1 to n do
readln(a[i]);
if (a[i] MOD k)=0 then s:=s+a[i];
writeln('S=',s);
End.
Program num1;
Uses crt;
Var
a :array [1..100] of integer;
i,k,n, s : integer;
Begin
clrscr;
s:=0;
write('K=');readln(k);
write('N=');readln(n);
for i:=1 to n do
readln(a[i]);
for i:=1 to n do
if (a[i] MOD k)=0 then s:=s+a[i];
writeln('S=',s);
End.