#include int length(int L1, int L2, int L3, int R, int B, int Y) { return (R * (L2 + L3) + B * (L1 + L3) + Y * (L1 + L2)) * 2; } int main(void) { int l1, l2, l3; int r, b, y; int ret, r0, r1, r2, s1, s2, s3; scanf("%d %d %d %d %d %d", &l1, &l2, &l3, &r, &b, &y); r0 = length(l1, l2, l3, r, b, y); r1 = length(l2, l3, l1, r, b, y); r2 = length(l3, l1, l2, r, b, y); s1 = length(l1, l3, l2, r, b, y); s2 = length(l3, l2, l1, r, b, y); s3 = length(l2, l1, l3, r, b, y); ret = r0; if(ret > r1) ret = r1; if(ret > r2) ret = r2; if(ret > s1) ret = s1; if(ret > s2) ret = s2; if(ret > s3) ret = s3; printf("%d\n", ret); return 0; }