N = int(input()) ans = 0 i = 1 while i * i <= N: if N % i == 0: j = N // i if i == j & i: ans += pow(2,bin(i).count('1')) i += 1 print(ans // 2)