The Tibetan alphabet is called the sum cu, the thirty, and the number is exact. Reaching it took an act of editing, because the Indic order the script descends from does not produce thirty consonants.
The inherited arrangement runs in five lines of five, each line a place of articulation and each line running unaspirated, aspirated, voiced, voiced aspirated, nasal. Tibetan has no voiced aspirates. The fourth column, the gha, jha, dha and bha of Sanskrit, writes a contrast the language simply does not make, and it was left out. That removes five letters. The retroflex line, the fifth of the five places, writes another set of sounds Tibetan lacks, and it too was left out, removing five more.
Against those subtractions the adapters made additions. The three affricates tsa, tsha and dza write sounds Tibetan has and Sanskrit does not, and were built from the palatal shapes. Zha, za and the small a were provided for. The result of the subtractions and the additions is a set of exactly thirty consonants in eight lines, which is what a Tibetan child recites.
The letters that were dropped did not stay dropped for long, because Tibetan became a language of Buddhist translation and had to write Sanskrit names and terms accurately. They came back as a separate apparatus: reversed forms for the retroflexes, and subjoined ha for the voiced aspirates. What they did not do was rejoin the recitation.