#include using namespace std; int main(){ int A, B, C, D, E; cin >> A >> B >> C >> D >> E; int ans = D, X = D; for(int i = 2; i <= A * (B - C); i++){ if(i % 10 == 0 && E <= X) X -= E; ans += X; } cout << ans; }