The Ares III mission was supposed to last 31 sols (a sol is a 24.5-hour Martian day). Just to be safe, NASA sent 68 sols’ worth of food, for six people. For Watney alone, that will last 300 sols, extended to 400 if he rations.
Watney needs 1,500 calories every day. He has 400 sols’ supply of food already. So how many calories does Watney need to generate per day during the entire time period to stay alive for 1,400 days total?
Fortunately, Watney has a supply of potatoes. He can use his own feces as fertilizer on the sterile Martian soil, to grow the vegetables.
Soil needs 0.3 gallons of water per cubic foot (40 liters per cubic meter). Watney needs a total of 163.26 gallons (618 liters) of water. The Hab has only 79.25 gallons (300 liters) available.
Water can be manufactured by burning hydrogen and oxygen.