cho.sh
Notes
Loading...

Lee-myeon and Im-hyeon

Time limit

2s

Memory limit

128 MB

Problem

A natural number can be classified in two ways: as a Lee-myeon number and as an Im-hyeon number.

A number is a Lee-myeon number if both conditions below hold.

  1. It belongs to the absolute class: the number is at least 4 and is not 5.
  2. The sum of its decimal digits is odd.

A number is an Im-hyeon number if at least one of the conditions below holds.

  1. The number itself is 2 or 4.
  2. The number is composite, and the number of distinct prime factors in its prime factorization is even.

A number that is neither Lee-myeon nor Im-hyeon is called a Seong-gyeong number.

Given a natural number N, print the result of this classification. Print 1 if N is only a Lee-myeon number, 2 if N is only an Im-hyeon number, 3 if N is neither, and 4 if N is both.

Input

The first line contains the natural number N to classify. It satisfies 1 <= N <= 2700.

Output

Print the classification result on the first line.

Hint

The number 11 belongs to the absolute class, but its digit sum is 1 + 1 = 2, which is even, so it is not a Lee-myeon number. It is not 2 or 4, and it is not composite, so it is not an Im-hyeon number either. Therefore it is a Seong-gyeong number.