#include <bits/stdc++.h>
using namespace std;
long long int DFS(long long int remain, int idx, long long int xx[3]) {
  if (idx == 2) return min(remain, xx[2]);
  long long int res = 0, t;
  if (xx[idx] < remain) {
    t = xx[idx];
    res = max(res, DFS(remain - t, idx + 1, xx) * t);
  }
  for (long long int i = -10; i <= 10; i++) {
    t = min(xx[idx], remain / (3 - idx) + i);
    if (t < remain) res = max(res, DFS(remain - t, idx + 1, xx) * t);
  }
  return res;
}
int main() {
  long long int x, y, z, k;
  cin >> x >> y >> z >> k;
  k += 3;
  long long int res = 0;
  if (k >= x + y + z) {
    cout << x * y * z << endl;
    return 0;
  }
  long long int xx[] = {x, y, z};
  sort(xx, xx + 3);
  do {
    res = max(res, DFS(k, 0, xx));
  } while (next_permutation(xx, xx + 3));
  cout << res << endl;
  return 0;
}
