#include "bits/stdc++.h" using namespace std; typedef long long ll; #define INF (1<<30) #define INFLL (1ll<<60) typedef pair P; typedef pair E; #define MOD (1000000007ll) #define l_ength size #define EPS (1e-10) void add_mod(ll &a, ll b){ a += b; a %= MOD; } void mul_mod(ll &a, ll b){ a *= b; a %= MOD; } string s; stack t; int p[123]; int calc(int l, int r){ int ret=0,d=1,v,i; for(i=l; i<=r; ++i){ if(s[i] == '+'){ d = 1; continue; }else if(s[i] == '-'){ d = -1; continue; } if(s[i] == '('){ v = calc(i+1,p[i]-1); i = p[i]; }else{ v = s[i]-'0'; } ret += d*v; } return ret; } int main(void){ int n,a[123456],i,ans=0; cin >> n; for(i=0; i> a[i]; --a[i]; } sort(a,a+n); for(i=0; i