require 'prime' a=gets.to_i.prime_division p a[0][0]!=2 ? a[0][0] : a[1][0]