I am assuming we would have a supply of water and something with which to cook and that the freezers would keep working normally. What would be a problem first; lack of protein, carbs or minerals? In my family's discussions we agree about the order in which we would eat the food, but not about how long it would last, 1 year, 5 years, a lifetime?
Some things have a short shelf life, like bread. Bread could be made from ingredients on shelves but not for very long, since there are not large stocks of such ingredients, and it only takes one to run out.
Obviously, the answer would be highly variable if the food is rationed, but the question is really about eating a healthy, balanced diet.