===Pascal ABC.Net===
program brainly;
var
number, summ :integer;
begin
Write('Введите число: ');
ReadLn(number);
while number <> 0 do
begin
if (number mod 10 <> 0) and
(number mod 10 <> 3) and
(number mod 10 <> 6) and
(number mod 10 <> 9) then summ += number mod 10;
number := number div 10;
end;
Write('Сумма цифр числа, не кратных трём: ', summ);
end.