def ff
    n = gets.chomp.to_i

    ev = 0
    od = 0

    r = 0
    b = 0
    an = gets.chomp.split(/\s/).map{|x|
        y = x.to_i
        if y%2 == 0
            ev += 1
            r ^= y
        else
            od += 1
            b ^= y
        end
        y
    }

    if n == 2
        puts an[0]+an[1]
        exit
    end

    #if ev == n
    #    max = an.sort[-1]
    #    puts r^max + max
    if ev == n or od == n
        bn = an.sort
        c = 0
        for i in 0..(n-2)
            c ^= bn[i]
        end
        puts c + bn[-1]
    else
        puts r+b
    end
end

ff
