#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double 
struct pt {
    ld x, y;
    void take() {
        int xx,yy;
        cin>>xx>>yy;
        x=xx,y=yy;

    }
};


const ld EPS = 1e-6;

ld dist(pt p1, pt p2) {
    return sqrt((p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y) *(p2.y - p1. y));
}

bool check_inside(pt p, ld r, pt center) {
    ld d = dist(p, center);
    if (d < r)
        return true;
    return (abs(dist(p, center) -  r) <= EPS);
}
ld crossProduct(pt p1,pt p2,pt p3){
    return (p2.x - p1.x) * (p3.y - p1.y) - (p2.y - p1.y) * (p3.x - p1.x);
}
void solve() {
    int d; cin >>d;
    ld r = d * .5;
    pt p1, p2;
    p1.take();
    p2.take();
    // if (p1.x == p2.x) {
    //     cout << 0;
    //     return;
    // }
    pt center = {r, r};
    if (!check_inside(p1, r, center) ||!check_inside(p2, r, center)) {
        cout << 0;
        return;
    }

    const ld PI = acos(-1);
    ld c = dist(p1, p2);
    ld a = dist(p1,center );
    ld b = dist(p2, center );
    ld co =   a *a + b *b - c *c;
    ld den = 2 * a *b;
    co /= den;
    ld angle = acos(co);
    angle *= 180;
    angle /= (ld)PI;
    ld walk = angle / (ld)360;
    walk *= 60;
    ld speed = 33 +( ld)1 / 3.0;
    walk /= speed;
    ld cross=crossProduct(center,p1,p2);
    if(cross>0){

    walk *= -1;
    } 
    cout << setprecision(10) << fixed;
    cout <<walk << endl;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }

    return 0;
}   