In a classroom, there are 40 students. Each student studies either Mathematics or Science or both. If 30 students study Mathematics and 25 students study Science, how many students study both subjects? Let's think step by step and output the final answer within \boxed{}.
user