Intersections

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

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

f(x)={0, \mboxifx<0 x2k,\mboxif2kx<2k+1,(kN_0) x+2(k+1) \mboxif2k+1x<2k+2, (kN_0)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) =xag(x) = {x \over a}

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

입력

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

출력

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

제한

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