The five men left in two groups. When each group walked to the door, the dog barked 1 minute, so when I met two groups of people tonight, the dog barked twice, each time 1 minute, for a total of 2 minutes.
This problem is mainly to train children's thinking ability.