var a,b: real;
begin
readln(a,b);
if (a>=18) and (b>=18) then writeln('1') else if (a<18) and (b<18) then writeln('2') else if (a>=18) or (b>=18) then writeln('3');
end.
var a,b: real;
begin
readln(a,b);
if (a>=18) and (b>=18) then writeln('1') else if (a<18) and (b<18) then writeln('2') else if (a>=18) or (b>=18) then writeln('3');
end.