#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-9;
int main(void) {
  long long sum = 1;
  long long A[3];
  long long a[3];
  int k;
  cin >> A[0] >> A[1] >> A[2] >> k;
  a[0] = a[1] = a[2] = 1;
  while (k > 0) {
    int index = 3;
    for (int i = 0; i < (int)(3); i++) {
      if (a[i] < A[i]) {
        long long tmp;
        a[i]++;
        tmp = a[0] * a[1] * a[2];
        a[i]--;
        if (tmp > sum) {
          sum = tmp;
          index = i;
        }
      }
    }
    if (index == 3) break;
    a[index]++;
    k--;
  }
  cout << sum << endl;
  return 0;
}
