open Printf
open Scanf

let read_int _ = scanf " %d " (fun x -> x)

let rec gcd a b = if b = 0 then a else gcd b (a mod b)

let () =
  let n = read_int () in
  let x::xs = Array.init n read_int |> Array.to_list in
  let res = List.fold_left (fun a v -> gcd a v) x xs in
  printf "%d\n" res
