The count (and related list) shown by MAME relating to machines with a horizontal screen is certainly incorrect.
The logic with which MAME carries out this counting should be reviewed.
In my opinion this should be the calculation to do:
1) Is there a display? If yes, it is horizontal with rotate=0/180, it is vertical with rotate=90/270.
2) Is there more than one display? I ignore them from the second onwards.
In this way we would have these results (with MAME 0.265):
18,218 "Horizontal Screen" (MAME lists 37,175)
3,207 Vertical Screen (MAME lists 3,210)
Would it be possible to make this small fix?
Thank you.
PS: The counting method was suggested to me by motischifo.