The mean of four numbers is 21. If three of the numbers are 18, 23 and 12, than the fourth number is

(18+23+12+x)/4 = 21

Now just find x