Abu Hurairah (May Allah be pleased with him) reported:
Messenger of Allah (ﷺ) said, "When one of you arrives in a gathering, he should offer Salam to those who are already there, and he should also do so when he intends to depart. The first act of greeting is not more meritorious than the last.''[Abu Dawud].
App reference: Book 6, Hadith 25
Arabic/English book reference: Book 6, Hadith 869