Josiah was the father of Jeconiah and his brothers. In their time, the Jewish people were taken into exile in Babylon.
After the exile to Babylon, the family line continued. Jeconiah was the father of Shealtiel. Shealtiel was the father of Zerubbabel.
So there were 14 generations from Abraham to David, there were 14 generations from David until the Jewish people were taken into exile in Babylon, and there were 14 generations from that time until the Messiah.