Stack height = measurement A plus measurement B:
Note that you can replace your headset with one of shorter stack height and just use spacers to take up the extra space. But you can't replace your headset with a taller headset than what you currently have.
If you have removed the headset cups and crown race from the frame and fork, you can measure the length of the frame head tube and the length of the fork steer tube from the race seat to the top. The difference between these two measurements is the maximum stack height your frame can accept.