Zack plans to attend the Carroll County Fair and is trying to decide what would be a better deal. He can pay $40 for unlimited rides, or he can pay $15 for admission plus $1 per ride. If Zack goes on a certain number of rides, the two options wind up costing him the same amount. How many rides is that?