What is the version of the following sentence with correct punctuation?

It is fairly small and has about 17000 inhabitants of which 13000 live in the main city Pothia
It is fairly small and has about 17,000 inhabitants, of which 13,000 live in the main city, Pothia.