#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;

const double INF = 1e40;
const double EPS = 1e-6;

struct pnt {
        double x , y;
        pnt () {}
        pnt ( double _x , double _y ) : x ( _x ) , y ( _y ) {}

        pnt operator + ( const pnt &other ) const {
                return pnt ( x + other.x , y + other.y );
        }
        pnt operator - ( const pnt &other ) const {
                return pnt ( x - other.x , y - other.y );
        }
        void rot() {
                swap ( x , y );
                x = -x;
        }
        double sq() {
                return x * x + y * y;
        }
};

double rx[4] , mar = 1e20;
double l = -EPS , r = 1e10 , m;
bool found;
pnt p[4] , fp[4];

inline void add ( double &a , double b ) {
        if ( a - EPS > b )
                a = b;
}

pnt intersect ( pnt a , pnt b , pnt c , pnt d ) {
        static double A[2] , B[2] , C[2];
        A[0] = b.y - a.y;
        B[0] = a.x - b.x;
        C[0] = a.x * b.y - a.y * b.x;

        A[1] = d.y - c.y;
        B[1] = c.x - d.x;
        C[1] = c.x * d.y - c.y * d.x;
        return pnt ( (C[0] * B[1] - C[1] * B[0]) / (A[0] * B[1] - A[1] * B[0]) ,
                     (C[0] * A[1] - C[1] * A[0]) / (A[1] * B[0] - A[0] * B[1] ) );
}


bool ok() {
        fp[2] = pnt ( rx[2] , m );
        pnt tmp , np = fp[2] - p[0];
        np.rot() , np.rot() , np.rot();
        tmp = np;
        np = fp[2] + np;


        fp[3] = intersect ( fp[2] , np , pnt ( rx[3] , -INF ) , pnt ( rx[3] , INF ) );
        fp[3].x = rx[3];

        tmp.rot() , tmp.rot() ,  tmp.rot();
        np = fp[3] + tmp;
        fp[1] = intersect ( fp[3] , np , pnt ( rx[1] , -INF ) , pnt ( rx[1] , INF ) );
        fp[1].x = rx[1];
        if ( fabs ( fp[1].x - rx[1] ) <= EPS )
                return 1;
        return 0;
}


int main() {
        int i;
        for (i = 1; i < 4; ++i) {
                scanf ( "%lf" , rx + i );
                rx[i] +=  rx[i - 1];
        }

        for (i = 0; i < 4; ++i)
                p[i] = pnt ( rx[i] , 0. );

        while ( l + EPS < r ) {
                m = (l + r) / 2.;
                if ( ok() ) {
                        found = 1;
                        add ( mar , (pnt ( rx[2] , fp[2].y ) - p[0]).sq() *
                                    (pnt ( rx[3] , fp[3].y ) - pnt ( rx[2] , fp[2].y )).sq() );
                        r = m;
                }
                else if ( fp[1].y >= -EPS )
                        r = m;
                else
                        l = m;
        }
        if ( !found )
                puts ( "0" );
        else
                printf ( "%.4lf\n" , floor ( sqrt ( mar ) ) );

        return 0;
}
