10232. Distinct Primes

http://www.spoj.com/problems/AMR11E/