function Main(input){
  input = input.split('\n');
  var NL = input[0].split(' ');
  var S = [];
  for(var i=0;i<Number(NL[0]);i++){
    S[i]=input[i+1];
  }
  var V = S.sort().reduce((a,b)=>a+b);
  console.log(V);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));