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