Three element X,Y and Z belongs to 17th group but to 2nd, 3rd and 4th period respectively

Three element X,Y and Z belongs to 17th group but to 2nd, 3rd and 4th period respectively.Number of valence electrons in Y is 7.Find the number of valence electrons in X and Y.

It will be 7 in X as well as in Z.
The reason being that number of electrons in outermost shell in the elements in same group is same.