var
a,b,x,y,z,i,j,n,m:longint;
s:array[0..999999] of integer;
begin
assign(input,'abnum.in');
assign(output,'abnum.out');
reset(input);
rewrite(output);
read(n);
y:=1; m:=1;
for i:=1 to n do
begin
z:=1;
while s[z]=1 do
begin
s[z]:=0;
x:=x-1;
y:=y+1;
z:=z+1;
end;
s[z]:=1;
x:=x+1;
if m>=z then y:=y-1 else m:=z;
if x>y then a:=a+1
else b:=b+1;
end;
write(a,' ',b);
close(input);
close(output);
end.