The mean is defined as the sum of the values divided by the number of values we have. In this case we have 7 values, then we have:
To find the median we first need to order the values; the ordered values are:
2, 3, 5, 5, 6, 7, 8
the mean is the central value. Since we have an odd number of them the median is exactly the value in the middle of the ordered set, then the mean is 5.
Therefore: