a,b,c,d,e=map(int,input().split()) n=(b-c)*a s=0 for i in range(n): if (i+1)%10>0: s+=d elif d