시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB59373370.213%

문제

You are given the following two functions. ($\mathbb{N}_0$ denotes the set of non-negative integers.)

$$f(x)= \begin{cases} 0, & \mbox{if } x < 0 \\ x - 2k, & \mbox{if } 2k \le x < 2k+1 \, (k \in \mathbb{N}_0) \\ -x + 2(k+1) & \mbox{if } 2k + 1 \le x < 2k+2 \, (k \in \mathbb{N}_0) \end{cases}$$

$$g(x) = {x \over a}$$

How many intersections between the graphs of $y=f(x)$ and $y=g(x)$ exist on the XY-plane?

입력

The first and only line of the input contains a single integer $a$.

출력

Print the number of intersections between the graphs of $y = f(x)$ and $y = g(x)$. If there are infinitely many intersections, print INF.

제한

  • $\left\vert a \right\vert \le 10^9$; $a \ne 0$
  • $a$ is an integer.

예제 입력 1

2

예제 출력 1

2

출처