In a school, there are 20 students in Class A and 30 students in Class B. In Class A, 8 students wear glasses. In Class B, 12 students wear glasses. If a student is selected at random from Class A or Class B, what is the probability that the student wears glasses?