Consider a performance measure that is evaluated via Monte Carlo simulation where input distributions to the underlying model may involve two stage sampling. The settings of interest include the case where in the first stage physical samples from the distribution are collected. In the second stage, Monte Carlo sampling is done from the observed empirical distribution. We also consider the sampling-importance resampling (SIR) algorithm. Here it is difficult to sample directly from the desired input distribution, and these samples are generated in two stages. In the first stage, a large number of samples are generated from a distribution convenient from the sampling viewpoint. In the second stage, a resampling is done from the samples generated in the first stage so that asymptotically the new samples have the desired distribution. We discuss how to allocate computational and other effort optimally the two stages to minimize the estimator's resultant mean square error.