#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

const int R = 6371;
const double PI = acos(-1.0);

int main() {
    freopen("dreamrun.in", "r", stdin);
    freopen("dreamrun.out", "w", stdout);

    double x, y, z;
    cin >> x >> y >> z;

    x = sqrt(x * x + y * y);
    double alph = acos(x / R);

    if (z <= 0) {
        alph = -alph;
    }

    double ans = (PI / 2 + alph - 1e-7) * R;

    cout.precision(11);
    cout << fixed << ans;

    return 0;
}
