#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline void remax(T1& A, T2 B) {
  if (A < B) A = B;
}
template <class T1, class T2>
inline void remin(T1& A, T2 B) {
  if (A > B) A = B;
}
long long Gcd(long long a, long long b) {
  if (!a || !b) return a + b;
  while (a %= b ^= a ^= b ^= a)
    ;
  return b;
}
long long Power(long long base, unsigned long long power) {
  long long ret = 1;
  while (power) {
    if (power & 1) ret *= base;
    power >>= 1;
    base *= base;
  }
  return ret;
}
long long PowerMod(long long base, unsigned long long power, long long mod) {
  if (!power) return 1 % mod;
  if (power & 1) return (base * PowerMod(base, power - 1, mod)) % mod;
  return PowerMod((base * base) % mod, power >> 1, mod);
}
FILE* Input = stdin;
inline void run() {
  int arr[4];
  for (int i = 0; i < 4;) scanf("%d", arr + i++);
  ++ ++ ++arr[3];
  while (arr[0] + arr[1] + arr[2] > arr[3]) {
    sort(arr, arr + 3);
    --arr[2];
  }
  printf("%I64d\n", (long long)arr[0] * arr[1] * arr[2]);
}
int main() {
  run();
  return 0;
}
