Jami` at-Tirmidhi, Book 42, Hadith 2 (Tirmidhi 2759)

Narrated 'Imran bin Husain:

"A man came to the Prophet (ﷺ) and said: 'As-Salamu 'Alaykum (Peace be upon you).'" "So the Prophet (ﷺ) said: 'Ten.' Then another came and he said: 'As-Salamu 'Alaykum Wa Rahmatullah (Peace be upon you, and the mercy of Allah).' So the Prophet (ﷺ) said: 'Twenty.' Then another came and said: 'As-Salamu 'Alaykum Wa Rahmatullahi Wa Barakatuh (Peace be upon you, and the mercy of Allah, and His Blessings).' So the Prophet (ﷺ) said: 'Thirty.'"