#include using namespace std; int main(){ int a,b,x,y; cin>>a>>b>>x>>y; if(a==b) cout<< min(x,y)*2 <b) cout<