In a remote county, 40 villages are connected by roads in such a way that three roads lead in and out of each village. There is only one road in and out of the county. How many roads are there in the county?