There are 800 x 5/8 = <<800*5/8=500>>500 girls.

So, there are 800 - 500 = <<800-500=300>>300 boys.

There are 500 x 7/10 = <<500*7/10=350>>350 girls that are in the primary grades.

Hence, 500 - 350 = <<500-350=150>>150 girls are middle schoolers.

There are 300 x 2/5 = <<300*2/5=120>>120 boys that are in the primary grades.

Hence, 300 - 120 = <<300-120=180>>180 boy students are middle schoolers.

Therefore, a total of 150 girls + 180 boys = <<150+180=330>>330 middle schoolers.

# Answer

330
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
In a school with 800 students, 5/8 of the students are girls. Seven-tenths of the girls and two-fifths of the boys are in the primary grades, while the rest are middle schoolers. How many middle schoolers are there?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
330
In a school with 800 students, 5/8 of the students are girls. Seven-tenths of the girls and two-fifths of the boys are in the primary grades, while the rest are middle schoolers. How many middle schoolers are there?
train