This might be a different variant of the typical birthday problem. Given a room of $n$ people, let $N$ be a random variable representing the number of people who have a birthday common with at least one other person. I will start by writing $$N = P_1 + P_2 + \cdots + P_n$$ where $P_i$ is an indicator random variable which is $1$ when person i's birthday is common with at least one other person in the room.
So we have by symmetry
\begin{align*} E[N] &= n E[P_1] \end{align*}
Now I note that person $1$'s birthday $D_1$ is a uniform random variable taking values in $\{1,2, ..., 365 \}$. Same for other people. Hence, by total expectation theorem
\begin{align*} E[N] &= n E[P_1]\\ &= n \sum_{k = 1}^{365} P(D_1 = k) E[P_1 | D_1 = k]\\ &= n \sum_{k = 1}^{365} \frac{1}{365} E[P_1 | D_1 = k]\\ &= n \sum_{k = 1}^{365} \frac{1}{365} \left(1 - \left(\frac{364}{365}\right)^{n-1} \right)\\ &= n\left(1 - \left(\frac{364}{365}\right)^{n-1} \right) \end{align*}
Is this right? If not, help me correct my argument. Thanks.