a, b, c, d, e = map(int, input().split()) ans = (b - c) * d print(ans)