#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <complex>
#include <ctime>
#include <cassert>
#include <functional>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef pair<int,int> PII;

#define REP(i,s,t) for(int i=(s);i<(t);i++)
#define FILL(x,v) memset(x,v,sizeof(x))

const int INF = (int)1E9;
#define MAXN 100005

int main() {
  int h, k, v, s, ans = 0;
  cin >> h >> k >> v >> s;
  while (h > 0) {
    v += s;
    v -= max(1, v / 10);
    if (v >= k) h++;
    else if (0 < v && v < k) {
      if (--h == 0) v = 0;
    }
    else if (v == 0) h = 0;
    ans += v;
    if (s > 0) s--;
  }
  cout << ans << endl;
  return 0;
}
