def main():
    l=input().split()
    a=int(l[0])
    b=int(l[1])
    c=int(l[2])
    x=int(l[3])
    y=int(l[4])
    if x>y:
        x, y=y, x
        a, b=b, a
    t=(x//2)*2
    print(a, b, c, x, y, t)
    if (a+b)/2<c:
        res=(a+b)*t
    else:
        res=c*t*2
    x-=t
    y-=t
    res+=min(a*x+b*y, c*2*y)
    print(res)

if __name__=="__main__":
    main()
