eolymp
bolt
Try our new interface for solving problems
Problems

Mysterious equation

Mysterious equation

Little Vasya is very fond of equations. Once his sight caught the equation $x + y + xy = n$. Vasya wants to know the number of pairs of non-negative integers $x$ and $y$, that are the solutions of this equation. \InputFile One integer $n~(0 \le n \le 10^9)$. \OutputFile Print the number of pairs of solutions. \Examples Below given all the solutions of equation $x + y + xy = 5$: \begin{itemize} \item $(x, y) = (0, 5)$ \item $(x, y) = (1, 2)$ \item $(x, y) = (2, 1)$ \item $(x, y) = (5, 0)$ \end{itemize}
Time limit 1 second
Memory limit 128 MiB
Input example #1
5
Output example #1
4
Input example #2
8
Output example #2
3