What do you understand by term valency?
Valency: The number of electrons gained, lost, or shared by the atom of an element so as to complete its octet (or duplet in the case of elements having only a K shell) is called the valency of the element.
Example: