#include <bits/stdc++.h>
using namespace std;
const int NMAX = 200005;
long long a[3], k;
int main() {
  cin >> a[0] >> a[1] >> a[2] >> k;
  while (a[0] + a[1] + a[2] - 3 > k) {
    sort(a, a + 3);
    a[2]--;
  }
  cout << a[0] * a[1] * a[2] << endl;
  return 0;
}
