For a car moving at a constant speed, the distance traveled varies directly with the time spent driving. If such a car travels 180 miles in 9 hours, how long does it take to travel 140 miles?