object Main {
  def main(args:Array[String]):Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val list = List.fill(n)(sc.nextLong)
    println(func(list.sorted))
  }

  def func(list:List[Long]) : Long = {
    val head = list.head
    val tail = list.tail

    if(head == 1){
      1
    }
    else{
      val newList = head :: tail.map(_ % head).filter(_ != 0)
      func(newList.sorted)
    }
  }
}