#include <algorithm>
#include <iostream>
using namespace std;

int main() {
  int H, K, V, S;
  while (cin >> H >> K >> V >> S) {
    int ret = 0;
    while (H > 0) {
      V += S;
      V -= max(1, V/10);
      if (V <= 0) {
        V = H = 0;
      } else if (V >= K) {
        H++;
      } else {
        H--;
        if (H == 0) V = 0;
      }
      ret += V;
      if (S > 0) S--;
    }
    cout << ret << endl;
  }
}
