import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.Comparator; import java.util.NoSuchElementException; public class Main { public static void main(String[] args) { new Main().run(); } long gcd(long a,long b) { return a==0?b:gcd(b%a,a); } void run() { FastScanner sc=new FastScanner(); int N=sc.nextInt(); long ans=0; long[] A=new long[N]; for (int i=0;i