In combinatorics, the rule of product states that if there are ways of doing one thing and ways of doing another thing, then there are ways of performing both actions.
In this case, if there are 7 ways of getting from town A to town B, and 8 ways of getting from town B to town C, then there are ways of getting from town A to town C via town B.