#include <bits/stdc++.h>
using namespace std;
void solve() {
  vector<long long> ip(3);
  for (long long i = 0; i < (3); i++) cin >> ip[i];
  long long k;
  cin >> k;
  sort(ip.rbegin(), ip.rend());
  long long res = 0;
  long long arr[3];
  for (auto i : {0, 1, 2}) {
    for (auto j : {0, 1, 2}) {
      for (auto l : {0, 1, 2}) {
        if (i != j && j != l && l != i) {
          arr[0] = ip[i];
          arr[1] = ip[j];
          arr[2] = ip[l];
          for (long long z = 0; z <= min(k, arr[2] - 1); z++) {
            long long rem = k - z;
            long long ver = min((rem + 1) / 2, arr[0] - 1);
            long long hor = min(rem - ver, arr[1] - 1);
            res = max(res, (ver + 1) * (hor + 1) * (z + 1));
          }
        }
      }
    }
  }
  cout << res << endl;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) solve();
}
