How is Matt Smith not the 12th Doctor (since David Tennant regenerated first into himself and then into Matt Smith)? Then wouldn't Peter Capaldi be the 13th Doctor? (Because that regeneration was a gift from the Time Lords thanks to Clara.)
Here's the "regeneration" you're referring to:
The key here is that, while the Doctor did use up one of his regenerations, he didn't actually regenerate. He used just enough of the regeneration energy to heal himself, then channelled the rest into his severed hand from "The Christmas Invasion", preventing himself from fully changing.
You can think of it like the scene in "Let's Kill Hitler" where River Song transfers the last of her regeneration energy into the Doctor to revive him: on both occasions, the energy brought him back to life, but he didn't regenerate. So he's still the Tenth Doctor.
It's complicated, more complicated than anyone knows exactly and this is why:
In the episode "The Brain of Morbeus" The Doctor faced a Timelord, a criminal mastermind who had survived execution called Morbeus. In a desperate attempt to thwart his plans, The Doctor goaded Morbeus into a mental duel.
They were both hooked to a machine which pitted all their mental resources from each of their many lives against the other's, their will and their knowledge and their determination to win, and to live.
The effort killed The Doctor, and reduced his enemy Morbeus to an insane gibbering wreck who threw himself off a cliff, so The Doctor - even in death won.
Whilst he was hooked up to the machine, The Doctor's and Morbeus's previous personas were displayed one by one as they were drawn into the contest - these images appeared among others:
None of the (lower row of) above images are of Doctors that we can pinpoint and name easily, they all appeared before the image of William Hartnell, Peter Cushing (had you forgotten him too? Here.) Michael Jayston (as per comments), David Bradley (Here) et al..
The Party line is that Peter Capaldi is the twelfth, but there's more to it, much more to it, perhaps more than even The Doctor himself knows - Rasillon knows, I don't.
Personally, I also thought that by regenerating into the "same" body, that ought to count as two separate Doctors. However, regardless of in-universe status, the numbering of the Doctors is really based on the out-of-universe actors who played the character. On that basis, since the actor did not change, the numbering of the Doctor did not change either.
There's another question on here that asks what "counts" as a regeneration - I've opined that it's not the amount of energy used, but the number of times the energy (and the process) is tapped into. The events of the show suggest they consider the rule to be the number of times the process is started.
This was all addressed in Matt Smith's last episode The Time of the Doctor. The War Doctor (played by John Hurt) was a regeneration The Doctor didn't acknowledge, but it certainly counted as a regeneration. So too did Ten's "partial" regeneration after getting hit by the Dalek beam. He chose to offload the regeneration energy into his severed hand. He retained the same body/regeneration, but the process was started, the energy was expended, so it too counted towards his twelve regeneration limit.
Moffat cannily hinted that the fans "had forgotten something" when it came to the regeneration limit, namely that Tennant regeneration. Comments online made it clear that damn near nobody forgot, and we were all keen to see what he was going to do, since by the rules, The Doctor had hit his limit.
So to answer the original question, Smith's regeneration indeed the twelfth regeneration, but the "extra" Doctor is The War Doctor. So technically, Eccleston was Ten, and Tennant was Eleven. They never "counted" the War Doctor, so Smith often referred to himself as "eleven", but he still counted as a regeneration.