The answer is 9, here are all the possible combinations...
road, road
road, bridge
road, ferry
bridge, bridge
bridge, ferry
bridge, road
ferry, ferry
ferry, bridge
ferry, boat
(or you can do 3 input combinations by 3 output combinations "3 x 3" = 9)
Cheers!