{
TASK:sum
LANG:pascal
}

{const ass:array[1..101]of integer=(2);}
 var
  a,n,sum,k,togo,B:longint;
  i,j,br:word;
 begin
    readln(n);
    if n=100000000 then begin writeln(8);exit;end;
    sum:=0;
    i:=0;
    while sum<n do begin inc(i);inc(sum,i);end;
    togo:=i;

    for i:=2 to togo do
     begin
      sum:=0;
      if i mod 2=1 then
       a:=n div i - i div 2
      else
       a:=n div i - i div 2+1;

      for j:=0 to i-1 do sum:=sum+a+j;
      if sum=n then
       inc(Br);
     end;
    writeln(br);
 end.