/*
Jackson Simoneau
SI@UCF 2026 - Intro to Competitive Programming
Contest 1

Solution to Fading Wind: https://open.kattis.com/problems/fadingwind
*/

#include <bits/stdc++.h>
using namespace std;

int main() {
    int h, k, v, s;
    cin >> h >> k >> v >> s;
    int dist = 0;

    //Just follow the procedure outlined in the problem
    while(h > 0) {
        v += s;
        v -= max(1, v/10);
        //If v is at least k, increase h by 1
        if(v >= k) h++;
        //If 0 < v < k, decrease h by 1
        else if(v > 0) h--;

        //Set v and h to 0 as necessary
        if(h == 0) v = 0;
        if(v <= 0) {
            h = 0, v = 0;
        }
        //Add the current velocity to the airplane's horizontal distance
        dist += v;
        if(s > 0) s--;
    }
    
    //Display the final result once the airplane hits the ground
    cout << dist << endl;
}