Some of the profits may be given to the shareholders in the form of dividends. The directors of the company in theory do not have to give any dividends to shareholders if they do not want to, for reasons such as difficult times or a period where the firm is investing highly.
Dividends are issued at the director's discretion.
Because of the above facts, your question cannot be answered. Not all profit is distributed to shareholders, because firms retain profit for investment projects possibly or for a continguency fund.
In your question you are assuming that all profit is given to shareholders, this is not the case. The answer will depend on policies of the firm i terms of dividend issuing and the proprtion of the profit which will be designated at retained earnings.
Once the directors and finance managers have come up with a some of money that they wish to supply to the shareholders, then this is supplied to them, according and relative to the amount of stock they own.
Does that help?