#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007;
const double pi = acos(-1);
const int N = 2e5 + 10;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, k, m, d, q = 1, ans = 0;
  cin >> n >> k >> m >> d;
  for (long long i = 1; i < d + 1; i++) {
    long long mx1 = m;
    long long mx2 = n / q;
    long long w = min(mx1, mx2) * i;
    ans = max(ans, w);
    q += k;
    if (q > n) break;
  }
  cout << ans;
}
