You'll want to express the number of students in each of the periods as a function of the number of students in a reference period.

Let x be first period, y second periodand z third period

We know what y=2x and z=3x-10

and x+y+z=158

Which you can then rewrite as a function of X

x+2x+3x-10=158

6x-10=158

6x=158+10

x=168/6

x=28

y=2*28

z=28*3-10

So first semester 28 students, second semester 56 students and third semester 74 students.

Cheers