program main
    implicit none
    integer::n,i,countn
    integer,allocatable::L(:),A(:,:)
    logical::judge=.true.
    read*, n
    if(n<1.or.n>100)then
        judge=.false.
    end if
    allocate(L(2*n),A(2,n))
    read*, L
    do i=1,2*n
        if(L(i)<=0.or.L(i)>100)then
            judge=.false.
        end if
    end do
    call array(2*n,L)
    call set(n,L,A)
    print *, countn(n,A)
end program main

subroutine array(n,L)
    implicit none
    integer,intent(in)::n
    integer,intent(inout)::L(n)
    integer::i,j,a
    do i=1,n-1
        do j=1,n-i
            if(L(j)>L(j+1))then
                a=L(j+1)
                L(j+1)=L(j)
                L(j)=a
            end if
        end do
    end do
end subroutine array
subroutine set(n,L,A)
    implicit none
    integer,intent(in)::n,L(2*n)
    integer,intent(out)::A(2,n)
    integer::i
    do i=1,n
        A(1,i)=L(2*i-1)
        A(2,i)=L(2*i)
    end do
end subroutine set
function countn(n,A)
    implicit none
    integer::n,A(2,n)
    integer::countn,i,m
    m=0
    do i=1,n
        m=m+A(1,i)        
    end do
    countn=m
end function countn