#include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ int a, b, c, d, e, t, r, sum1 = 0; cin >> a >> b >> c >> d >> e; t = (b -c)*a; r = t/10; for (int i = 1; i <= t; i++){ if (i%10) sum1 += d; else if (d > e){ d = d-e; sum1 += d; } else sum1 += d; } cout << sum1 << endl; }