Yup, that's how it goes.
People make it very complicated talking about the carbs, sugar, blaablaablaa. And yeah your body does process them differently.
But in the end it's quite simple. Calories is the amount of energy you consume. You can also calculate (with some level of accuracy) the...