When it comes to losing weight, it turns out the simple maths of counting calories does not always add up.Fad diets come and go, but the underlying message almost always follows a simple equation: if you consume fewer calories than you burn, the weight will melt away.In principle, it is true. And counting calories can be a useful tool for managing weight. But it only works if you know what numbers you are counting. And what has been billed as basic maths can sometimes look more like Einstein’s theory of relativity.That is because a complex web of factors influences how, or even if, our bodies process calories. And it turns out diet quality is just as important as quantity, and possibly more.“Different foods have very different effects on the brain, liver, fat cells, muscle function, pancreas and all organs related to metabolism and body weight,” says Dr Dariush Mozaffarian, a cardiologist and director of the Food is Medicine Institute at Tufts University in the US state of Massachusetts.Counting calories could burn youA calorie is the unit of energy released by eating carbohydrates, proteins and fats. That sounds simple, but the complexity of counting calories went mainstream recently, when a lawsuit accused the maker of David protein bars of misrepresenting how many calories and how much fat the products contain. The lawsuit has since been dropped.