var i,k: integer;
begin
k:=0;
for i:=111 to 999 do
if((i mod 10)=(i mod 100 div 10)) and ((i mod 10)=(i div 100)) then k:=k+1;
write(k);
end.
var i,k: integer;
begin
k:=0;
for i:=111 to 999 do
if((i mod 10)=(i mod 100 div 10)) and ((i mod 10)=(i div 100)) then k:=k+1;
write(k);
end.