Unless the population proportion is very skewed, you can use p=.5 and q=.5
E=.005; confidence level of 99% implies `z_(alpha/2)=2.58` and
Thus to get an error of 1/2% with 99% confidence, you need a sample size of at least 66564.
** You may question the ability to use p=q=.5 As long as the population isn't very divided, the numbers are approximately the same. Using 40% and 60% yields 266256*.24=63901. Even 70%-30% gives 266256*.21=55914, so the use of 50-50 is justified. **