#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 != 1 && ame % 10 == 0 && X - e >= 0) X -= e; total += X; } cout << total << '\n'; } int main() { FastIO; solve(); return 0; }