#include using namespace std; long primeFactors(long n) { if (n==1) return 1; list l; while (n%2 == 0) { l.push_back(2); n = n/2; } for (long i = 3; i <= sqrt(n); i = i+2) { while (n%i == 0) { l.push_back(i); n = n/i; } } if (n > 2) l.push_back(n); long ans=l.front()+1; l.pop_front(); while(!l.empty()){ ans = l.front()*ans + 1; l.pop_front(); } return ans; } int main() { int n; cin >> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } long ans=0; for(int i=0;i