#include <bits/stdc++.h>
using namespace std;
long long a, b, c, k, aa, bb, cc = 0;
int main() {
  scanf("%I64d%I64d%I64d%I64d", &a, &b, &c, &k);
  if (a > b) {
    int r = a;
    a = b;
    b = r;
  }
  if (a > c) {
    int r = a;
    a = c;
    c = r;
  }
  if (b > c) {
    int r = b;
    b = c;
    c = r;
  }
  aa = min(a - 1, (k + 2) / 3);
  k -= aa;
  bb = min(b - 1, (k + 1) / 2);
  k -= bb;
  aa++;
  bb++;
  printf("%I64d\n", aa * bb * min(k + 1, c));
  return 0;
}
