A, B, C, D, E = map(int, input().split()) N = A * (B - C) print(sum(max(D - E * (i // 10), D % E) for i in range(1, N + 1)))