A,B,C,D,E=map(int,input().split());a,j,m=(B-C)*A,D,D for i in range(1,a+1): if E<=j and i%10==0:a=max(j-E,0);D+=a-j;j=a D+=j print(D-m)