#include using namespace std; long max_factor(long a) { for(long b=a/2;b>=1;b--) { if(a%b==0) { return b; } } return 1; } long compute(long stick_length) { long total_move=stick_length; while(stick_length!=1) { stick_length=max_factor(stick_length); total_move+=stick_length; } return total_move; } long longestSequence(vector a,int n) { // Return the length of the longest possible sequence of moves. long complete_move=0; for(int i=0;i> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } long result = longestSequence(a,n); cout << result << endl; return 0; }