The Prophet used to say: "Whoever performs prayer in congregation at the mosque for forty nights, never missing the first Rak'ah of the 'Isha' prayer, Allah will thereby decree for him salvation from the Fire."
Sunan Ibn Majah Book 4, Hadith 64