output_description: Print an integer representing the minimum possible total price of fruits.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
      p_1 p_2 \ldots p_N
attempt: import sys
  
  sys.setrecursionlimit(10**9)
  
  
  # input = sys.stdin.readline    ####
  def int1(x):
      return int(x) - 1
  
  
  def II():
      return int(input())
  
  
  def MI():
      return map(int, input().split())
  
  
  def MI1():
      return map(int1, input().split())
  
  
  def LI():
      return list(map(int, input().split()))
  
  
  def LI1():
      return list(map(int1, input().split()))
  
  
  def LLI(rows_number):
      return [LI() for _ in range(rows_number)]
  
  
  def MS():
      return input().split()
  
  
  def LS():
      return list(input())
  
  
  def LLS(rows_number):
      return [LS() for _ in range(rows_number)]
  
  
  def printlist(lst, k=" "):
      print(k.join(list(map(str, lst))))
  
  
  INF = float("inf")
  # from math import ceil, floor, log2
  # from collections import deque
  # from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
  # from heapq import heapify, heappop, heappush
  # import numpy as np
  # from numpy import cumsum  # accumulate
  
  
  def solve():
      N, K = MI()
      P = LI()
      P.sort()
      print(sum(P[:K]))
  
  
  if __name__ == "__main__":
      solve()
  
problem_description: Statement
  
  A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots,
  p_N yen per item, respectively. (Yen is the currency of Japan.)
  
  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find
  the minimum possible total price of those fruits.
samples: [{"input": "5 3\n    50 100 80 120 80", "output": "210\n    \n\nThis shop sells Fruit 1, 2, 3, 4, and 5 for 50 yen, 100 yen, 80 yen, 120 yen,\nand 80 yen, respectively.\n\nThe minimum total price for three kinds of fruits is 50 + 80 + 80 = 210 yen\nwhen choosing Fruit 1, 3, and 5.\n\n* * *"}, {"input": "1 1\n    1000", "output": "1000"}]