#include <cmath>
#include <vector>
#include <iostream>
using namespace std;
const double moondist = 380000;
const double kaguyadist = 1900;
const double moontime = 2500000;
const double kaguyatime = 7200;
const double moonradius = 1800;
const double pi = acos(-1.0);
double sqr(double x) {
    return x * x;
}
int main() {
    double l = moondist, r = moondist + kaguyadist;
    for(int i = 0; i < 100; ++i) {
        double m = (l + r) * 0.5;
        double tcos = (m * m + moondist * moondist - kaguyadist * kaguyadist) / (2 * m * moondist);
        double tsin = sqrt(1.0 - sqr(tcos));
        if(tsin < moonradius / moondist) r = m;
        else l = m;
    }
    double threshold = l;
    int M, T;
    cin >> M >> T; T *= 60;
    double theta = (M / 360.0) * (2 * pi);
    int sep = 1000000;
    double ans = 0.0;
    for(int i = 0; i <= 2 * sep; ++i) {
        double t = double(T) * i / (2 * sep);
        double mx = moondist * cos(theta + t / moontime * (2 * pi));
        double my = moondist * sin(theta + t / moontime * (2 * pi));
        double mz = 0.0;
        double vx = -kaguyadist * sin(t / kaguyatime * (2 * pi));
        double vy = 0.0;
        double vz = kaguyadist * cos(t / kaguyatime * (2 * pi));
        double kx = mx + vx;
        double ky = my + vy;
        double kz = mz + vz;
        double dist = sqrt(sqr(kx) + sqr(ky) + sqr(kz));
        if(dist > threshold) {
            if(i == 0 || i == 2 * sep) ans += 1;
            else if(i % 2 == 0) ans += 2;
            else ans += 4;
        }
    }
    ans /= 6 * sep;
    ans *= T;
    cout.precision(15);
    cout << fixed << ans / 60.0 << endl;
    return 0;
}
