In a group of $n$ people, there are $k$ individuals who each have exactly two acquaintances among the present. Among the remaining $(n-k)$ members of the group, no two know each other.

What is the maximum number of handshakes that can occur if the strangers introduce themselves to each other? (We consider the acquaintance between two people to be mutual. Each introduction involves a handshake between the two participants.)
Let's denote the number of necessary handshakes by $S$, and the number of handshakes that do not occur by $N$. The sum $(S+N)$ represents the total number of possible handshakes among $n$ people. If everyone shakes hands with everyone else, each person will shake hands $(n-1)$ times. In the product $n(n-1)$, each handshake would be counted twice, so the number of handshakes is half of this product:

$$
S+N=\frac{1}{2} n(n-1)
$$

Therefore, the maximum possible value of $S$ is obtained by subtracting the minimum value of $N$ from $\frac{1}{2} n(n-1)$:

$$
S_{\max }=\frac{1}{2} n(n-1)-N_{\min }
$$

It is sufficient to determine the minimum number of handshakes that will definitely occur if the acquaintances shake hands. Those who have already shaken hands twice have done so with two different people. Since there are $k$ such people, this results in at most $2k$ handshakes, as we might have counted each handshake twice—i.e., if both parties are among the $k$ selected individuals—but not more than twice; thus, at least $k$ handshakes will definitely occur, so $N_{\min }=k$.

Indeed, it is possible for $N_{\min }$ to be exactly $k$, i.e., if the group of people who have two acquaintances, referred to as the "two-acquaintance club," turns out to be such that each member's two acquaintances are also club members. This is clearly only possible if $k \geqq 3$. If in this case each club member shakes hands with one of the two acquaintances using one of their hands, the club will form one or more circles, and each circle will have at least 3 members. This $k$-number of "handshakes" constitutes the $N$ "unnecessary" handshakes, $N_{\min }=k$, and in this case,

$$
S_{\max }=\frac{1}{2} n(n-1)-k
$$

In the case of $k=2$, there will be either 1 "handshake" within the club or none, so $N_{\min }=2 \cdot 2-1=3$; in the case of $k=1$, the single distinguished guest will have 2 introductions left, and respectively,

$$
S_{\max }=\frac{1}{2} n(n-1)-3, \quad \text { or } \quad S_{\max }=\frac{1}{2} n(n-1)-2
$$