Here some narrations that force us to believe that they have more or sometimes less that 12 imams.
Kulayni in “Kafi” (1/448):
17. Muhammad ibn Yahya has narrated from Muhammad ibn Ahmad from Muhammad ibn al-Hassan from Sa˜id al-˜Usfuriy from Amran ibn Thabit from abu al-Jarud from abu Ja˜far (a.s.) who has said the following.
“the Messenger of Allah has said, I and twelve persons from my descendants and you O Ali, are the securing anchor of the earth, that is, the pillars thereof and its ropes. Through us Allah has secured the earth from devouring the inhabitants. If all the twelve persons from my family will no longer be there, the earth will devour her inhabitants without delay.”
Twelve person from descendants plus Ali=13.
Kulayni also reported in “Kafi” vol 1, p 534:
Through the same chain of narrators it is narrated from abu Sa˜id in a marfuâ˜ manner from abu Ja˜far (a.s.) who has said the following. “The Messenger of Allah (sallalahu alayhi wa alihi) has said, “From my descendants there will be twelve noble supervisors, who are (Muhaddathun) persons to whom angles speak and very intelligent. The last of them will be Al-Qaim (the one who will rise with Divine Authority) and with truth who will fill the earth with justice after being filled with injustice.”
Ali (r.a) wasn’t from descendants of prophet (sallalahu alaihi wa ala alihi wa sallam). So again 12 plus 1=13 imams.
Kulayni also reported in “Kafi” 1/533
From Zurara who has said the following. “I heard abu Jafar say, There will be twelve Imams from the family of Muhammad (sallalahu alayhi wa ala alihi) and they all will be (Muhaddathun), persons to whom angles speak. They will of the descendants of the Messenger of Allah and Ali ibn abu Talib (a.s.). The Messenger of Allah and Ali are their anscesters.”
12 aimma, and Muhammad (sallalahu alayhi wa ala alihi wa salam) and Ali (r.a) are their anscesters.