#include #include #include #include #include #include int main() { int n; std::cin >> n; long long moves=0; long long mod_n=1e15; std::vector a(n); for(int i=0;i>a[i]; } /* Enter your code here. Print output to STDOUT */ for(int i=0;i maps; if(length==1){ moves+=1; continue; } long long cur=2; while(length>1 && cur<=sqrt(a[i])+1){ while(length%cur==0){ length/=cur; ++maps[mod_n-cur]; } ++cur; } if(maps.size()==0){ moves+=length+1; continue; } if(length>1){ ++maps[mod_n-length]; } length=a[i];counts=1; for(auto temp:maps){ long long div=mod_n-temp.first,num=temp.second; while(num){ --num; moves+=counts; length/=div; counts*=div; } } moves+=counts; } std::cout<