you have to read through the entire process to understand. each point proves the next to finally answer your question.
In Perek 17 we are told about Avraham Getting the Brit Milah. In Perek 18 we don't even mention it so how come Rashi knows that Avraham needed healing?
According to Midrash Rabbah and the yalkut shimoni- Why does Mamre get his cave mentioned at the beginning of Perek 18? Because Avraham Avinu talked over with three people if he should publicize the Brit Milah? Why was Avraham Avinu worried?
Avraham Avinu was אב המון גוים[shabbat 105a] and according to the seforno and the rav{from YU}, he felt his job was to show G-d to the world, and if he publicized it then people would think him as different and won't follow him, thus causing his mission to fail. Mamre was there to guide Avraham in doing the right thing and that is why he is mentioned at the beginning of perek 18. Mamre's connection is only relevant to the topic of Brit Milah thus proving that Avraham already went through it.
We know Avraham was 99 and he just got something painful but the text shows how Avraham was running around for the guests. So, we have 2 questions where are all the other guests and if Avraham was so sick how can he run around?
Answering question number one, Avrahm felt that others stayed away because they thought he was different. answering question number 2 since the only source for their being pain is that the perek begins with Mamre and that proves that Avraham just got the Brit Milah, so how could he run to serve his guests. A 99-year-old man who just got something very painful done to him, thus he had to have been healed. Every angel can only do one task at a time [not going into the reason because that is deep kabala which I don't understand]. there were three angles and that explains why we were only told about the job of 2 of the angels. Thus we understand why 3 angels.