Matthew 1:17

17 Thus there were fourteen generations in all from Abraham to David, fourteen from David to the exile to Babylon, and fourteen from the exile to the Messiah.

Read Matthew 1:17 Using Other Translations

So all the generations from Abraham to David are fourteen generations; and from David until the carrying away into Babylon are fourteen generations; and from the carrying away into Babylon unto Christ are fourteen generations.
So all the generations from Abraham to David were fourteen generations, and from David to the deportation to Babylon fourteen generations, and from the deportation to Babylon to the Christ fourteen generations.
All those listed above include fourteen generations from Abraham to David, fourteen from David to the Babylonian exile, and fourteen from the Babylonian exile to the Messiah.