      program main
      integer i, n
      integer*8 t, ans, lcm
      ans = 1
      read(*,*) n
      do i = 1 , n
            read(*,*) t
            if(t .ne. ans) then
                  ans = lcm(ans, t)
                  if(ans .gt. 50000000) exit
            end if
      end do
      write(*,*) ans
      end

      function lcm(a,b)
      integer*8 lcm, a, b, gcm
      lcm = a / gcm(a,b) * b
      end function

      function gcm(a,b)
      integer*8 gcm, a, b, c, i
      integer f
      f = 0
      gcm =1
      if (a .lt. b) then 
            c = a
      else
            c = b
      end if
      do i = 2, c, gcm+f*gcm*(gcm-1)
            f = 0
            if((mod(a,i) .eq. 0) .and. (mod(b,i) .eq. 0)) then
                  gcm = i
                  f = 1
            end if
      end do
      end function