15
A total of 39 took psychology. 12 of those took that and science and another 10 of those took that and history. 2 people took all three. 12+10+2 = 24 students who took psychology along with another class. To find the number of students who took ONLY psychology, you would take 39 and subtract 24, which leaves you with 15.