Let's call the rate paid by Stefan as r1 on the first spot and r2 on the second spot and the amount of hours he parked as h. On the first parking spot, he can pay a flat rate of $8, this gives to us the following equation for the cost on the first place
Or, in the second place, he can pay $1 per parked hour, which gives us the following equation
Since for the length of time Stefan spent on Fairview both options were equivalent, we have
From the first equation, we know that he spent $8 and by the second equation we know that he spent 8 hours.