// Arup Guha
// 2/25/2023
// Solution to SER 2022 Shared Problem: Fading Wind

using namespace std;

#include <iostream>

#define max(a,b) (a)>(b)?(a):(b)

int main() {

    int h, k, v, s;
    cin >> h >> k >> v >> s;

    int res = 0;

    // They say to do this.
    while (h > 0) {

        // Then this.
        v += s;
        v -= max(1, v/10);

        // And this.
        if (v >= k) h++;
        else if (v > 0) h--;

        // And this.
        if (h == 0) v = 0;

        // Stop!
        if (v <= 0) {
            h = 0;
            v = 0;
        }

        // We move!
        res += v;

        // Last step.
        if (s>0) s--;
    }

    cout << res << endl;

    return 0;
}
