12. $(\mathbf{C H N} 3)^{\mathrm{IMO} 3}$ Let $S=\{1,2,3, \ldots, 280\}$. Find the minimal natural number $n$ such that in any $n$-element subset of $S$ there are five numbers that are pairwise relatively prime.
12. Let \( A_{m} \) be the set of those elements of \( S \) which are divisible by \( m \). By the inclusion-exclusion principle, the number of elements divisible by 2, 3, 5, or 7 equals
\[ \begin{aligned} & \left|A_{2} \cup A_{3} \cup A_{5} \cup A_{7}\right| \\ & =\left|A_{2}\right|+\left|A_{3}\right|+\left|A_{5}\right|+\left|A_{7}\right|-\left|A_{6}\right|-\left|A_{10}\right|-\left|A_{14}\right|-\left|A_{15}\right| \\ & \quad-\left|A_{21}\right|-\left|A_{35}\right|+\left|A_{30}\right|+\left|A_{42}\right|+\left|A_{70}\right|+\left|A_{105}\right|-\left|A_{210}\right| \\ & =140+93+56+40-46-28-20-18 \\ & \quad-13-8+9+6+4+2-1=216 . \end{aligned} \]
Among any five elements of the set \( A_{2} \cup A_{3} \cup A_{5} \cup A_{7} \), one of the sets \( A_{2}, A_{3}, A_{5}, A_{7} \) contains at least two, and those two are not relatively prime. Therefore \( n > 216 \).

We claim that the answer is \( n = 217 \). First notice that the set \( A_{2} \cup A_{3} \cup A_{5} \cup A_{7} \) consists of four primes (2, 3, 5, 7) and 212 composite numbers. The set \( S \backslash A \) contains exactly 8 composite numbers: namely, \( 11^{2}, 11 \cdot 13, 11 \cdot 17, 11 \cdot 19, 11 \cdot 23, 13^{2}, 13 \cdot 17, 13 \cdot 19 \). Thus \( S \) consists of the unity, 220 composite numbers, and 59 primes. Let \( A \) be a 217-element subset of \( S \), and suppose that there are no five pairwise relatively prime numbers in \( A \). Then \( A \) can contain at most 4 primes (or unity and three primes) and at least 213 composite numbers. Hence the set \( S \backslash A \) contains at most 7 composite numbers. Consequently, at least one of the following 8 five-element sets is disjoint with \( S \backslash A \), and is thus entirely contained in \( A \):
\[ \begin{array}{ll} \{2 \cdot 23, 3 \cdot 19, 5 \cdot 17, 7 \cdot 13, 11 \cdot 11\}, & \{2 \cdot 29, 3 \cdot 23, 5 \cdot 19, 7 \cdot 17, 11 \cdot 13\}, \\ \{2 \cdot 31, 3 \cdot 29, 5 \cdot 23, 7 \cdot 19, 11 \cdot 17\}, & \{2 \cdot 37, 3 \cdot 31, 5 \cdot 29, 7 \cdot 23, 11 \cdot 19\}, \\ \{2 \cdot 41, 3 \cdot 37, 5 \cdot 31, 7 \cdot 29, 11 \cdot 23\}, & \{2 \cdot 43, 3 \cdot 41, 5 \cdot 37, 7 \cdot 31, 13 \cdot 17\}, \\ \{2 \cdot 47, 3 \cdot 43, 5 \cdot 41, 7 \cdot 37, 13 \cdot 19\}, & \{2 \cdot 2, 3 \cdot 3, 5 \cdot 5, 7 \cdot 7, 13 \cdot 13\}. \end{array} \]
As each of these sets consists of five numbers relatively prime in pairs, the claim is proved.