#C8550. Consecutive Sum Representations

    ID: 52545 Type: Default 1000ms 256MiB

Consecutive Sum Representations

Consecutive Sum Representations

Given a positive integer N, determine the number of ways to represent N as a sum of one or more consecutive natural numbers. One can show that if we take a sequence of k consecutive numbers starting from a, then their sum is given by:

$$ N = k \times a + \frac{k(k-1)}{2} $$

Your task is to compute the number of different pairs \((a, k)\) such that the equation holds and a is a natural number (i.e. a positive integer).

Note: A sequence containing a single number is also considered as consecutive.

inputFormat

A single line containing one positive integer N (1 ≤ N ≤ 10^12).

outputFormat

Output a single integer representing the number of ways to express N as the sum of one or more consecutive natural numbers.## sample

5
2