In a class of 40 students, 25 students like mathematics and 20 students like science. All of them like at least one subject. How many students like both mathematics and science?
A 5
B 10
C 15
D 7