var n, s, i: integer;
begin
write('Nhap n = ');
readln(n);
s := 0;
i := 3;
while i <= n do
begin
s := s + i;
i := i + 3;
end;
writeln('Tong la ', s);
readln;
end.
program tinh_tong_S;
var
n, i, S: integer;
begin
write('Nhap n: ');
readln(n);
S := 0;
for i := 3 to n step 1 do
begin
if i mod 2 = 0 then
S := S + i;
end;
writeln('Tong S la: ', S);
readln;
end.