require 'prime' n=gets.to_i g=Prime.prime_division(n) if g[0][0]==2 if g[1] if g[1][0]==3 p 3 else p 4 end else p 4 end else p g[0][0] end