n = int(input())
numeros = list(map(int,input().split()))
removido = numeros.pop(0)
flag = True
while True:
    if len(numeros) == 0:
        break
    else:
        if removido % 2 == 0:
            for i in range(len(numeros)):
                if numeros[i] % 2 == 1:
                    removido = numeros.pop(i)
                    flag = True
                    break
                else:
                    flag = False
        else:
            for i in range(len(numeros)):
                if numeros[i] % 2 == 0:
                    removido = numeros.pop(i)
                    flag = True
                    break
                else:
                    flag = False
           
    if flag == False:
        break
print(sum(numeros))
