There are different approaches to buying groceries. One common way to make the dollar stretch and cover the bases is to make a menu, list the ingredients, and buy for seven breakfasts, lunches, and dinners. One can save on sales, buy extra of canned goods, and use "extra money" to buy bulk items like 100 pounds of rice, wheat and beans.
A menu that may be eaten in an American home for a family of 5: (Approximate cost are in parentheses). frozen pizza($5.00), tacos (2.5# hamburger- $5.00, shells $1.00, lettuce $.70, olives $1.00, tomatoes $1.40, cheese$2.00) hamburgers ( meat from the taco purchase, buns $.90), rice a roni with a chicken breast (2 boxes - $2.00, chicken breasts - $6.00), spaghetti ($2.00) with a prepared sauce($1.00) and french bread($1.00) on the side, pork chops($8.00) with baked potatoes(5 # for $1.50) and green beans(2 cans $1.00), and mac and cheese(3 boxes $2.00) with hot dogs (1 package $1.00). This menu will cost $42.60 if I've added correctly. The exact prices don't matter, neither does getting the best deal. All this food will be gone in by the end of the week. Nothing will remain on the shelf.
Another approach is to buy basics 25 # rice ($7.80), 25 # flour ($5.60), 25 # salt ($3.60), 20 pounds potatoes ($6.00), 2 dozen eggs ($2.00), 4 # Pinto beans ($2.60), 4 # yeast ($4.40), 2 #oil ($2.00), 10 pounds sugar ($5.00) 4 pounds of chicken ($4.50), 1 small jar of peanut butter ($1.40) and/or another flavoring (meat, spice, boullion,etc) for $3.00). Total cost is a little less that $45.50. At the end of a week, feeding 10 people, leftovers will be 20# rice, 24 pounds salt, 1 pound pinto beans, 3.5 pounds of yeast, 1 pound of oil, and the garlic. In one week we have a substantial start on our shelf stable menu.
Does it help if the menu changes to include split peas instead of frozen pizza? Yes and no. Split peas are shelf stable, cheap and a great source of protein. But if only enough is purchased to prepare one meal, the families' health is maintained or preserved, but there is nothing to show for long term storage. The Rent is paid but no tability has been built with long term investments of food.
Picking items with the greatest versatility is the trick. The basics of flour, salt, sugar, baking powder/yeast and oil can make hundreds of baked goods: french bread, tortillas, cookies, pie dough, egg drop noodles, thickening agent, pita bread, english muffins, etc... There are countless ways to serve rice including stir fry, rice with chicken, rice with beans, rice pudding, as a pizza crust, just plain with milk and sugar, etc... Pinto beans are also very versatile: refried, chili and other soups, in fudge, as an appetizer, in a meatless burger, etc... The more versatile the first basic ingredients one chooses to buy, the longer the food will last.
The gamble is how much can I invest on this "long term" foods while meeting other basic needs and stay in the budget until the end of the month. After all adding garlic and cumin and basil and jelly and sandwich bags on top of 13 gallons of milk/week ... has brought my total expenditure to date to $222.40. How long will those supplies last while feeding ten? We have already (in 5 days of baking) gone through 25 pounds of flour making 15 loaves of bread, 3 batches of snickerdooldes, 1 batch of oatmeal cookies, 2 coffee cakes, and one batch of tortillas. I'm in suspense to find out how to play the next 13 days.