#include #include #include #include #include #include #define LL long long using namespace std; const int maxn=1e5+10; struct node { int x; int Fx; } ls[maxn]; int main() { int n; while(~scanf("%d",&n)) { int sum=0; for(int i=0;i