Hey guys I just tried the anton and digits problem , hope you might like my solution feel free to comment better solution .
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int two, thr, fv, sx,ans, Min;
ans=0;
cin>>two>>thr>>fv>>sx;
Min = two;
if(Min>fv)
Min=fv;
if(Min>sx)
Min=sx;
ans = Min*256;
two = two – Min;
Min = two;
if(Min>thr)
Min=thr;
ans = ans+Min*32;
cout<<ans<<endl;
return 0;
}