n = gets a = 3 while n % a != 0 do a += 1 end puts a