You didn't explain the periodicity and other details.
- Is the membership fixed or do they come and go?
- Does the contract continue to gain/lose on operations, or is this a wrap-up and final settlement?
In the simplest case I can think of, all members join (deposit), then things happen, then you establish the entitlement of each member at a point in time and stop gains/losses. You let them each withdraw 3/5 (0.6) of an ether.
A more fluid arrangement would involve the use of tokens. You sell tokens to yourself for 1 ether to bootstrap things with a "par" value of 1 ether/token. Then the contract offers to buy (redemption) or sell (issuance) at a price set by a formula. Mintable and burnable token design allows for as many tokens as people want to buy and destroys them on redemption.
The price would be
ether on hand/tokens in circulation
So, with 3 ether on hand and 5 tokens in circulation, the price would be 3/5 (0.6) ether for 1 token. Someone will redeem a token for 3/5 (0.6) ether, leaving 2.4 ether on hand and 4 tokens outstanding. Someone else sells and they get 1/4 of 2.4 which is also 0.6 (as it should be).
Members would join and leave as/when they wish (by purchasing and redeeming tokens). The operations and subsequent gains/losses would be continuous with no need for cut-off times in the calculation. A caveat would be that the world of off-chain assets is not so tidy.
Not legal advice. Not investment advice. Check the math. Your mileage may vary. Void where prohibited.