a,b,c,d,e=map(int,input().split()) m=a-b for i in range(c): a+=d b+=e #print(f" Loop : {i} Max: {a-b}") if m < a-b: m=a-b print(m)