The answer would be: 1000 alleles
The number of alleles will determine the possible combination of the phenotype. The flies have two kinds of color: brown or ebony bodies. Since there is two possible phenotype, the allele should be two. Then, if there are 500 flies and there are two alleles for every fly, the number of alleles would be: 500 flies * 2 alleles/fly= 1000 alleles