Divide the amount of money you have available to invest in the stock by its current share price.
For example, if you have $1,000 to invest and a stock is trading for $40, this equals 25 shares. Of course, in the real world, you will probably not get a whole number, and that's why the next step is needed.
Determine the number of shares you can buy
If your broker allows you to buy fractional shares, or you got a whole number in the second step, the result is the number of shares you can buy. If you can't buy fractional shares, round down to the nearest whole number.