Sayyiduna Imran bin Husain (may Allah be pleased with him) said: A companion came to the Prophet (peace and blessings be upon him) and said: "As-salamu Alaikum." The Prophet (peace be upon him) replied and said: "Ten." Then another companion came and greeted in this way: "As-salamu Alaikum wa Rahmatullah." The Prophet (peace be upon him) replied to him as well and said: "Twenty." Then another companion came, greeted, and said: "As-salamu Alaikum wa Rahmatullahi wa Barakatuh." The Prophet (peace be upon him) replied and said: "Thirty" (meaning for these three words, there are thirty good deeds for him).
Hadith Referenceسنن دارمي / من كتاب الاستئذان / 2676