During the epidemic, Teacher Zhao distributed masks to the students in the class. If half of the students receive 5 masks each and the other half receive 7 masks each, there will be 25 masks left. If one-third of the students receive 10 masks each and the remaining two-thirds receive 7 masks each, there will be a shortage of 35 masks. How many masks did Teacher Zhao prepare in total?