function Main(input) {

  var input = input.split("\n")
  var n = input[0];
  var arya = input[1].split(" ").map(val => parseInt(val, 10)).slice(0, n);

  if(arya.length > 2) {
    var checkary = arya.map(function(num) {
      var count = 0;
      for(var i=1; i<=arya[0]; i++) {
        if((num%i == 0)) {
          count++;
        }
      }
      return count;
    });

    var index = checkary.indexOf(Math.min.apply(null,checkary));
    arya.splice(index, 1);
  }

  var f = (a, b) => b ? f(b, a % b) : a
  var result = arya[0];
  for (var i = 1; i < arya.length; i++) {
    result = f(result, arya[i]);
  }

  console.log(result);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));