Here's a list of possible, non-perishable foods you could have prepared and ready to carry, together with their calorie-content per gram of weight:
Roasted peanuts - 6.00 cal/g
Crisps - 5.47 cal/g
Oats So Simple - 5.4 cal/g
Sugar - 5.0 cal/g
Powdered milk - 4.6 cal/g
Instant noodles - 4.4 cal/g
Peperami (long one) - 4.2 cal/g
Kit kat (2 finger) - 4.2 cal/g
Cereal bar - 4.2 cal/g
Plain porridge oats - 3.6 cal/g
Weetabix - 3.4 cal/g
Savoury rice - 3.2 cal/g
Cup-a-soup - 3.1 cal/g
White bread - 2.7 cal/g
Instant potato - 2.5 cal/g
Banana - 1 cal/g
Not an exhaustive list, I know, but hopefully illustrates the wide range of energy contents of different foods. So, it's much lighter to snack on peanuts and crisps rather than trying to take a sandwich for example! Also, noodles are more efficient than rice.
Specialist backpacking foods will tend to have higher cal/g ratings than the noodles, etc, mentioned above, but they are a lot more expensive.
If you're walking all day, on relatively level, firm ground, with a mid-weight pack, you're going to burn through 3000 calories plus. Of course, you don't need to replace all these, as many of us generally have some excess fat reserves

Over a short 4-5 day bug-out episode, balanced nutrition isn't important. It's all about calories and fluid intake.
Hope this is useful.