If Person A is your 23rd great grandfather, and Person B is the 8th great grandfather of Person A, then Person B is your 33rd great grandfather.
If you add the two "great" numbers together, you have to add 2 on top of that, because otherwise the two generations between Person A and his grandparent are not counted.