#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[3], k;
  for (int i = (0); i < (int)(3); i++) scanf("%d", a + i);
  sort(a, a + 3);
  scanf("%d", &k);
  k += 3;
  long long ans = 0;
  do {
    for (int u = (1); u <= (int)(k - 2); u++) {
      if (u > a[0]) break;
      int r = k - u;
      int b = min(r / 2, a[1]);
      int c = min(r - b, a[2]);
      ans = max(ans, (long long)u * b * c);
    }
  } while (next_permutation(a, a + 3));
  printf("%I64d\n", ans);
  return 0;
}
