#include <bits/stdc++.h>
using namespace std;
int main() {
  double d;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long double max_finaly = 0;
  long double max_in_loop;
  long double numper_people_in_loop;
  long double time_orginall;
  long double number_of_cand, number_of_peopel, max_candle_pair_one, time;
  cin >> number_of_cand >> number_of_peopel >> max_candle_pair_one >> time;
  time_orginall = time;
  while (time--) {
    max_in_loop =
        min(max_candle_pair_one,
            floor((number_of_cand) / ((number_of_peopel * (time + 1) + 1))));
    max_finaly = max(max_in_loop * (time + 1 + 1), max_finaly);
  }
  max_finaly = max(max_candle_pair_one, max_finaly);
  if (time_orginall == 1)
    cout << max_candle_pair_one;
  else
    cout << (long long)max_finaly;
  return 0;
}
