const
  nmax=100;
var
  f,g:text;
  a:array[0..nmax] of boolean;
  n,i,j,p:integer;
begin
  assign(f,'input.txt');
  assign(g,'output.txt');
  reset(f);
  rewrite(g);
  readln(f,n);
  for i:=0 to n-1 do a[i]:=false; 
  a[0]:=true;
  j:=0;
  for i:=1 to n do
    begin
       j:=(j+i) mod n;
       a[j]:=true;
    end;
  if n mod 2 =0 then
  for i:=1 to n do
    begin
       j:=(j+i) mod n;
       a[j]:=true;
    end;
  
  p:=0;
  for i:=0 to n-1 do if a[i] then p:=p+1;
  writeln(g,p);    
  close(f);
  close(g);

end.
