What gets designated a sperate class and what gets designated as the same class is not subject to hard and fast rules at all.
Arguably 317 & 318 could be the same class, and 320 to 322 another. Pushing it a bit, all of class 317, 318, 319, 320, 321, 322, 455 and 456 are pretty much the same design in different varients (even 325 perhaps).
The latest 377s will be really quite different to the orginal ones, to the extent that 379s could be regarded as the same class. And 375s are the same thing as orignal 377s- so that's more or less the same class, that comes in 3-5 car formations (mainly 4), in DC-only, AC only and dual voltage, with a heavily revised version (379 and 377/6-8) that's partly numbered the same, split across three class numbers (14 subclasses)- 410 units, that could probably be classed as one class with far less subclasses.
There's a fair bit of variation between 172s (preumably as with the 168s, Chilterns 172s can work with 16x not 15x?).
Bascially, don't go looking for logic in why some are classes whilst some are subclasses.
Quick totting up:
317-325, 455, 456 "mega class" would be 500 units (including scrapped)
375, 377 and 379 would be 410 units - 484 if 357s were considered as the same thing
"1972" design 313-315, 507, 508: 217units
450, 350, 360: 240 units
168-171: 157 units