Connections in a state
A certain fictional state has 12 cities in it, each with railroads emanating from them. The cities have (in no particular order) \[ 1,1,2,2,3,3,4,4,4,5,8,9\] Railroads emanating from them. Define a Connection to be a path from \(A\) to \(B\) through a certain city \(C\). \(A\) and \(B\) do not have to be distinct (i.e. sightseers going to a city then returning), though \(A \rightarrow C \rightarrow B\) is distinct from \(B \rightarrow C \rightarrow A\). Find the number of possible connections in this state.