#BS0000058. Thừa số nhỏ (Small Factors)
Thừa số nhỏ (Small Factors)
Small Factors
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
Consider the set
$$C_{2,3}=\left\{2^i3^j\mid i,j\in\mathbb{Z}_{\ge0}\right\}.$$Given a positive integer , find the smallest number such that and .
Equivalently, find the smallest integer not less than whose prime factorization contains no prime other than and .
Input
The only line contains a positive integer .
Output
Print the smallest satisfying .
Subtasks
- Subtask 1 — 20%: .
- Subtask 2 — 30%: .
- Subtask 3 — 50%: .
Example
Input
100
Output
108
Explanation
, and no value in lies between and .