Following Imam Ali there are eleven leaders in his progeny (Peace be on them). The first of them is his son, Hasan, then Husayn, then Ali ibn Husayn, then Muhammad ibn Ali, then Ja'far ibn Muhammad, then Musa ibn Ja'far, then Ali ibn Musa, then Muhammad ibn Ali, then Ali ibn Muhammad, then Hasan ibn Ali then al-Hujjah al-Qa’im al-Mahdi al-Hadi ibn Hasan, Master of the Time (May Allah hasten his blessed advent). They are all rightful Imams, one after another, for each one of them designated the next one as his successor. The reports of this designation are continuous. The Holy Prophet himself has said: "This son of mine, Husayn is an Imam, son of an Imam, brother of an Imam and father of nine Imams. The ninth of them is their Qa'im who will fill the earth with justice and fairplay as it be filled with tyranny and oppression."
source : http://www.islamicecenter.com/e-library/logic_islamic_rules/logic_islamic_rules_makarem_subhani_03.html