See the R script in attachment, in which you could fiddle with the number of subjects until you find the right number, or you could add another loop to run multiple Monte Carlo simulations with difference numbers of subjects. It also includes a power test.