Prime program using Semaphore abstraction
