#include"bits/stdc++.h" #define REP(i,n) for(int i=0,i##_len=(n);iy) swap(x,y); int Lx=32-__builtin_clz(x),Ly=32-__builtin_clz(y); return x?GCD(x,y^(x<<(Ly-Lx))):y; } bool Usable(int x,int g){ int Lx=32-__builtin_clz(x),Lg=32-__builtin_clz(g); while(Lx>=Lg&&x!=0){ x^=g<<(Lx-Lg); Lx=32-__builtin_clz(x); } return x==0; } int main(){ int N;cin>>N; int M=0, G=0; ll S=0; vector A(N); vector f(100001); REP(i,N){ cin>>A[i]; M=max(M, A[i]); G=GCD(G, A[i]); S += A[i]; f[A[i]]++; } vector mi(M+1, 0); for(int i=1;i<=M;++i){ for(int j=i;j<=M;j+=i){ mi[i]+=f[j]*(j-j/i); } } ll X=S; while(G<=M){ X = min(X, S-mi[G]); G<<=1; } cout<