2021 USAMO Problems/Problem 4

Problem

A finite set $S$ of positive integers has the property that, for each $s\in S$, and each positive integer divisor $d$ of $s$, there exists a unique element $t \in S$ satisfying $\gcd(s,t)=d$ (the elements $s$ and $t$ could be equal).

Given this information, find all possible values for the number of elements of $S$.