import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.Locale;

import static java.lang.Math.*;

public class dreamrun_ag {
    Scanner in;
    PrintWriter out;

    final int R = 6371;

    void solve() {
        double x = in.nextDouble();
        double y = in.nextDouble();
        double z = in.nextDouble();

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

        double toEquator = 0;
        if (z >= 0) {
            toEquator = alph * R;
            alph = 0;
        }

        double l = 0, r = PI / 2 - alph;

        for (int i = 0; i < 10000; i++) {
            double m = (l + r) / 2;

            double walked = toEquator + m * R;
            double around = 2 * PI * R * cos(alph + m);

            if (walked < around) {
                l = m;
            } else {
                r = m;
            }
        }

        out.printf("%.11f%n", toEquator + l * R);
    }

    void run() {
        try {
            in = new Scanner(new File("dreamrun.in"));
            out = new PrintWriter("dreamrun.out");
            solve();
            out.close();
            in.close();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    public static void main(String[] args) {
		Locale.setDefault(Locale.US);
        new dreamrun_ag().run();
    }
}
