#include <bits/stdc++.h>
using namespace std;
long long rx, ry, rz, k, ans, xx, yy, zz;
int main() {
  scanf("%I64d%I64d%I64d%I64d", &rx, &ry, &rz, &k);
  if (k > rx + ry + rz - 3) k = rx + ry + rz - 3;
  for (long long y = 0; y <= min(ry - 1, k); y++) {
    long long mid = (k - y) / 2;
    long long l = max(0ll, k - y - rz + 1), r = min(rx - 1, k - y);
    if (l > r) continue;
    if (mid > r)
      mid = r;
    else if (mid < l)
      mid = l;
    if ((mid + 1) * (y + 1) * (k - mid - y + 1) > ans) {
      ans = (mid + 1) * (y + 1) * (k - mid - y + 1);
      xx = mid;
      yy = y;
      zz = k - mid - y;
    }
  }
  printf("%I64d", ans);
}
