#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(int)(n); i++)

using namespace std;
using LL = long long;
using P = pair<int,int>;

int main(){
	double a, b, c, d, e, f;
	cin >> a >> b >> c >> d >> e >> f;
	double r=f-e+c*c/4+d*d/4;
	cout << fixed << setprecision(10) << sqrt(r) << endl;

	return 0;
}