var
i,j,x0,x1,n,a,b:longint;
s:ansistring;
begin
assign(input,'abnum.in');
assign(output,'abnum.out');
reset(input);
rewrite(output);
readln(n); s:=s+'00'; inc(x0);
for i:=1 to n do
begin
j:=1;
while s[j]='1' do
begin
s[j]:='0';
inc(j);
dec(x1); inc(x0);
if j>length(s) then s:=s+'0';
end;
if s[j]='0' then
begin
if j<length(s) then dec(x0);
inc(x1);
s[j]:='1';
end;
if x1>x0 then inc(a) else inc(b);
end;
writeln(a,' ',b);
close(input);
close(output);
end.