program cc(input,output);
var
a:array[1..99999999]of longint;
i,x1,x0,xa,xb,j,n,h,q:longint;
begin
assign(input,'abnum.in');
assign(output,'abnum.out');
reset(input);
rewrite(output);
read(n);
for i:=1 to n do
begin
repeat
inc(j);
a[j]:=i mod 2;
h:=h div 2;
until h=0;
for q:=1 to j do
begin
if a[q]=0 then x0:=x0+1 else x1:=x1+1;
if x1>x0 then xa:=xa+1 else xb:=xb+1;
end;
x1:=0;
x0:=0;
j:=0;
end;
writeln(xa,' ',xb);
close(input);
close(output);
end.