var
N, count:integer;
begin
write('N = ');
readln(N);
count := 0;
while N > 0 do
if (N mod 10) mod 3 = 0 then
count := count + 1;
N := N div 10;
end;
writeln('Count = ', count);
readln;
end.
var
N, count:integer;
begin
write('N = ');
readln(N);
count := 0;
while N > 0 do
begin
if (N mod 10) mod 3 = 0 then
count := count + 1;
N := N div 10;
end;
writeln('Count = ', count);
readln;
end.