package yukiCoder; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class No00275 { public static void main(String[] args) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); try { int index = Integer.parseInt(bufferedReader.readLine()); String[] input = new String[index]; input = bufferedReader.readLine().split(" "); int[] intArray = toIntArray(input); Arrays.sort(intArray); System.out.println(median(intArray)); } catch (IOException e) { e.printStackTrace(); } } public static int[] toIntArray(String[] stringArray) { int[] intArray = new int[stringArray.length]; for (int i = 0 ; i < stringArray.length ; i++) { intArray[i] = Integer.parseInt(stringArray[i]); } return intArray; } public static double median(int[] intArray) { int center1 = intArray.length/2; if(intArray.length%2 == 0) { int center2 = center1 - 1; return (intArray[center1] + intArray[center2]) / 2d; } return intArray[center1]; } }