@staticmethod
def b():
    (n, k, *p) = map(int, sys.stdin.read().split())
    print(sum(sorted(p)[:k]))
@staticmethod
def b():
    (n, k, *p) = map(int, sys.stdin.read().split())
    print(sum(sorted(p)[:k]))