There are 15 red, 10 green and 9 white balls in the dark room. Jack wants to take a minimal number of balls such that at least 8 of them have the same color. What is the number of balls that he takes?