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))
  }

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

    if(min == 1){
      1
    }
    else{
      func(min :: list.map(_ % min).filter(_ != 0))
    }
  }
}