We've got to think like a 7 year old child and use methods that might be more likely to be being taught to them...
So I think they'd be using "chunking" rather than algebra.
I imagine a teacher helping the child to make conclusions thusly:
There are 6 girls to 1 boy. That makes 7. Now we need to find out how many 7's go into 170.
We know (a chunk of) 10 x 7 is 70, so how about 20 x 7? That's 140.
Leaving us with 30 (but that's less than another chunk of 10 x 7) so we need smaller chunks.
So let's work with single numbers instead of 10's. If we try 1 x 7 we get 147 in total. But that's not it, because that's 21 boys and 23 teachers.
So how about another single chunk?
That's (10x7) + (10x7) + (1x7) + (1x7) which is... 154. That leaves us with 16 teachers, and that's 6 teachers less than the 22 boys we've counted!
Honestly when I first heard of chunking I thought it was stupid but it sure beats algebraic equations for the younger student, and I realised I'm using it all the time in real life (like when you count money made up of lots of different counselling for instance).