n=gets.to_i
(n-100).upto(n+100) do |x|
    if x % 2 == 0 && x != 2
        p x
        break
    end
end