local mfl, mce = math.floor, math.ceil local bor = bit.bor local n = io.read("*n") local ret = 0 for i = 1, n do if n < i * i then break end if n % i == 0 then local j = mfl(n / i) if bor(i, j) == j then local r = 1 local ti, tj = i, j while 0 < tj do if ti % 2 == 1 and tj % 2 == 1 then r = r * 2 end ti = mfl(ti / 2) tj = mfl(tj / 2) end ret = ret + r end end end print(mfl(ret / 2))