import java.io.BufferedInputStream; import java.util.PriorityQueue; import java.util.Scanner; public class Main { public static void main(String[] argv){ Scanner sc = new Scanner(new BufferedInputStream(System.in)); int n = sc.nextInt(); long[] a= new long[n]; for(int i = 0 ; i < n ; i++){ a[i] = sc.nextLong(); } if (n == 1) System.out.println(a[0]); PriorityQueue que = new PriorityQueue<>((x, y)-> Long.compare(y, x)); for(int i = 0 ; i< n; i++){ que.add(a[i]); } int t = 0; while(que.size()>1){ long x = que.poll(), y = que.poll(); if (t==0){ que.add(x*y); }else{ que.add((y+x-1)/x); } t^=1; } System.out.println(que.poll()); } }