program abnum;
var
n,i,z,a,b:longint;
x,y:array[0..20000001] of longint;
begin
assign(input,'abnum.in');
reset(input);
readln(n);
close(input);
a:=1;
b:=0;
x[0]:=0;
y[0]:=0;
x[1]:=0;
y[1]:=1;
for i:=2 to n do
begin
x[i]:=x[i shr 1]+((i+1) mod 2);
y[i]:=y[i shr 1]+(i mod 2);
if y[i]>x[i] then inc(a) else inc(b);
end;
assign(output,'abnum.out');
rewrite(output);
writeln(a,' ',b);
close(output);
end.