In order to find the maximum amount of electrons that an element with the 3rd valence shell can hold, we need to set up a simple electron configuration:
1s2 2s2 2p6 3s2 3p6 4s2 3d10
The 3rd shell will stop at the d orbital, therefore we need to sum the electrons present in the 3rd shell:
3s2 3p6 3d10
2 + 6 + 10 = 18 electrons is the maximum number of electrons for the 3rd shell