https://codeforces.com/problemset/problem/479/A
#include<bits/stdc++.h>
using namespace std;
int ans=0;
int main(void)
{
int a,b,c; cin>>a>>b>>c;
ans=max(ans,a+b+c);
ans=max(ans,a+b*c);
ans=max(ans,a*(b+c));
ans=max(ans,(a+b)*c);
ans=max(ans,a*b*c);
cout<<ans;
return 0;
}