a, b, c, d, e = map(int, input().split()) value = 0 for i in range(1, a*(b-c)+1): if e <= d and i % 10 == 0: d -= e value += d print(value)