The psychology lab at a college is staffed by 8 male doctoral students, 6 female doctoral students, 16 male undergraduates, and 9 female undergraduates. If a person is selected at random from the group, find the probability that the selected person is an undergraduate or a female.