#include <bits/stdc++.h>
using namespace std;
int main() {
  long long k;
  long long x[3], ans = 1;
  for (int i = 0; i < 3; ++i) {
    cin >> x[i];
  }
  cin >> k;
  sort(x, x + 3);
  if (x[0] + x[1] + x[2] <= k + 3) {
    ans = x[0] * x[1] * x[2];
  } else if (x[0] * 3 <= k + 3) {
    k -= x[0] - 1;
    ans *= x[0];
    if (x[1] + x[1] <= k + 2) {
      k -= x[1] - 1;
      ans *= x[1] * (k + 1);
    } else {
      long long a = k / 2;
      long long b = k % 2;
      ans *= (a + 1) * (a + b + 1);
    }
  } else {
    long long a = k / 3;
    long long b = k % 3;
    if (b == 0) {
      ans = (a + 1) * (a + 1) * (a + 1);
    } else if (b == 1) {
      ans = (a + 1) * (a + 1) * (a + 2);
    } else {
      ans = (a + 1) * (a + 2) * (a + 2);
    }
  }
  cout << ans << endl;
  return 0;
}
