Semiprime numbers are natural numbers that are products of exactly two (possibly equal) prime numbers.


Semiprimes   are also known as:

   semi-primes
   biprimes
   bi-primes
    2-almost    primes
   or simply:    P2  


Example
 
   1679  =  23 × 73  

(This particular number was chosen as the length of the Arecibo message).



Task

Write a function determining whether a given number is semiprime.



See also

 The Wikipedia article:  semiprime.
 The Wikipedia article:  almost prime.
 The OEIS sequence:  A001358: semiprimes  which has a shorter definition: the product of two primes.


 
REM Semiprime
PRINT "Enter an integer ";
INPUT N
N = ABS(N)
 
Count = 0
IF N >= 2 THEN
  FOR Factor = 2 TO N
    NModFactor = N MOD Factor
    WHILE NModFactor = 0
      Count = Count + 1
      N = N / Factor
      NModFactor = N MOD Factor   
    WEND
  NEXT Factor
ENDIF
 
IF Count = 2 THEN 
  PRINT "It is a semiprime."
ELSE 
  PRINT "It is not a semiprime."
ENDIF
END
 