Based on levels in her blood and liver, it would’ve been around 25-40 pills. But due to the technology back in 1962, we cannot be exactly certain.
We also cannot confirm how much she took over the course of the day, or hours. What we do know is Marilyn had a tolerance to these drugs and would take more than the prescribed dose to feel the effects quickly. Due to her insomnia, it is likely that she took more to help her sleep. Whether she realised that the amount was lethal or not cannot be determined. This is why it cannot be confirmed if she intended to kill herself. Barbiturates are no longer in use to treat insomnia and are strictly regulated as their lethal dose is very unpredictable depending on the individual.