#include <bits/stdc++.h>
using namespace std;
long long n, k, m, d, i = 0, b = 1, ans = 0;
int main(void) {
  cin >> n >> k >> m >> d;
  for (i = 1; i <= d && b <= n; i++, b += k) {
    ans = max(ans, min(m, n / b) * i);
  }
  cout << ans;
  return 0;
}
