#include<iostream>
#include<cmath>
#define SIN 0.01745329252
#define LEN 20037.39210386
using namespace std;
double a, b, c, d, e, f;
int main() {
	while (true) {
		cin >> a >> b >> c >> d;
		if (a < 0) { break; }
		e = abs(b - d);
		if (e > 180) { e = 360 - e; }
		f = abs(a - c);
		cout << sqrt(sin(f*SIN)*sin(f*SIN)*e*e*LEN*LEN / 32400 + f*f*LEN*LEN / 32400) << endl;
	}
}