Median is basically the middle number of a set of numbers, in either increasing or decreasing order. If there are odd number of numbers, there will only be one middle number. But if it even, you will have to take the sum of the 2 numbers and divide them by 2.
The picture shows how to find the largest possible value of x.
The other picture shows how to find the mean, which is the total date divided by the number of people.