program Project12; {$APPTYPE CONSOLE} label 1; var N,i,A,B,S:integer; begin 1:writeln('Vvedit chyslo ne bilshe 50'); readln(N); if N>50 then begin writeln('Chyslo bilshe 50'); goto 1;end else for i:=n to 50 do begin A:=i div 10; B:=i mod 10; if (A+B) mod 3=0 then S:=S+i;end; write(S,' '); readln; end.