The first line has one integer .The second line has integers .It's guaranteed that is a permutation of
Output the minimum weight of you can get.
5 4 3 2 5 1
5