Three non negative numbers A, B and C are such that the mean is X and the median is 7. If X is 12 more than the smallest number and 17 less than the biggest number. Find the value of A + B + C.