var i,i1,i2,count1,count2:integer;
begin
count1:=0;
count2:=0;
for i:=0 to 100 do
if (i mod 10=3) then inc(count1);
for i:=0 to 50 do
begin
i1:=i mod 10;
i2:=i div 10;
if (i1+i2=3) then inc(count2);
end;
writeln (count1);
writeln (count2);
readln;
end.