5 3 8 1 9 2 7 3
6
import heapq nums=list(map(int,input().split())) k=int(input()) print(sum(heapq.nsmallest(k,nums)))