A, B, C, D, E = map(int, input().strip().split(' ')) cnt = (B - C) * A amt = 0 for i in range(1, cnt + 1): if i % 10 != 0 and E <= D: D = max(D - E, 0) amt += D print(amt)