#include <iostream>
int main()
{
int k, m, n, d;
std::cin >> k >> m >> n >> d;
int t1 = k * m + m * n + n * k;
int t2 = k * m*n;
int a = t1 < t2 ? t2 * d / (t2 - t1) : -1;
std::cout << a << std::endl;
return 0;
}
#include <iostream>
int main()
{
int k, m, n, d;
std::cin >> k >> m >> n >> d;
int t1 = k * m + m * n + n * k;
int t2 = k * m*n;
int a = t1 < t2 ? t2 * d / (t2 - t1) : -1;
std::cout << a << std::endl;
return 0;
}