PROGRAM double_factorial

  IMPLICIT NONE
  INTEGER :: N, i, fac, arxi
  
  PRINT *, "Dwse akeraio"
  READ *, N

  IF (N > 19) STOP

  IF (MOD(N,2) == 0) THEN    ! N artios
     arxi = 2
  ELSE                       ! N perittos
     arxi = 1
  ENDIF

  fac = 1
  DO i = arxi,N,2
     fac = fac * i
  END DO

  PRINT *, "To ", n, "!! einai", fac

END PROGRAM double_factorial
