#include #define FastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false)) #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; void solve() { int a, b, c, d, e; cin >> a >> b >> c >> d >> e; int total = 0; int X = d; for (int ame = 1; ame <= a * (b - c); ame++) { if (ame % 10 == 0 && e <= X) total += X - e; else total += X; } cout << total << '\n'; } int main() { FastIO; solve(); return 0; }