#include using namespace std; #define int long long int n; int a[20]; int ans=-(1LL<<55LL); set si[20]; void dfs(int v,int s){ if(v==n){ ans=max(ans,s); return; } if(si[v].count(s)) return; si[v].insert(s); dfs(v+1,s+a[v]); dfs(v+1,s-a[v]); dfs(v+1,s*a[v]); if(a[v]) dfs(v+1,s/a[v]); } signed main(){ cin>>n; for(int i=0;i>a[i]; dfs(1,a[0]); cout<