import java.lang.Math.*

fun main(args:Array<String>):Unit {
    val moonRadius:Double = 1800.0
    val moonApoapsis:Double = 380000.0
    val kaguya = Orbit(Point(0.0, 0.0, 100 + moonRadius), 2 * PI / 7200, Vector(.0, 1.0, .0))
    val (m, t) = readLine()!!.trim().split(' ').map(String::toInt)
    val moon = Orbit(Point(cos(m * PI / 180) * moonApoapsis, sin(m * PI / 180) * moonApoapsis, .0), 2 * PI / 2500000, Vector(.0, .0, -1.0))
    var shadowingTime = 0
    val moonSize = sqrt(moonApoapsis * moonApoapsis - moonRadius * moonRadius) / moonApoapsis
    for (time in 0 .. 60 * t){
        val moonPos = moon.positionAt(time)//
        val kaguyaVector = (kaguya.positionAt(time) + moonPos).toVector()
        val moonVector = moonPos.toVector()
        //if (time % 3600 == 0) println(kaguyaVector)
        if (kaguyaVector.length >= moonSize * moonApoapsis && kaguyaVector.cos(moonVector) > moonSize) {
            ++shadowingTime
        }
    }
    println(shadowingTime / 60.0)
}
class Orbit(startPosition:Point, private val mVelocity:Double, private val mAxis:Vector){
    private val mStartPosition = startPosition.toQuaternion()
    fun positionAt(currentSecond:Int):Point {
        val q = Quaternion.screwLeft(mAxis, mVelocity * currentSecond)
        return (q * mStartPosition * conjugate(q)).toPoint()
    }
}
data class Point(val x:Double, val y:Double, val z:Double){
    constructor(x:Int, y:Int, z:Int):this(x.toDouble(), y.toDouble(), z.toDouble())
    operator fun plus(that:Point):Point = Point(x + that.x, y + that.y, z + that.z)
    operator fun minus(that:Point):Point = Point(x - that.x, y - that.y, z - that.z)
}
fun Quaternion.toPoint():Point{
    return Point(this.i, this.j, this.k)
}
fun Point.toQuaternion():Quaternion{
    return Quaternion(0e0, this.x, this.y, this.z)
}
data class Vector(val x:Double, val y:Double, val z:Double){
    val length:Double = sqrt(x * x + y * y + z * z)
    private fun map(transformer:(Double) -> Double):Vector = Vector(transformer(x), transformer(y), transformer(z))
    operator fun times(other:Double):Vector = map{it * other}
    operator fun div(other:Double):Vector = map{it / other}
    fun dot(that:Vector):Double = x * that.x + y * that.y + z * that.z
    fun cos(that:Vector):Double = dot(that) / length / that.length
}

fun Vector.toQuaternion():Quaternion {
    return Quaternion(0e0, this.x, this.y, this.z)
}
fun Point.toVector():Vector{
    return Vector(this.x, this.y, this.z)
}
data class Quaternion(val real:Double, val i:Double, val j:Double, val k:Double){
    operator fun plus(that:Quaternion):Quaternion = Quaternion(real + that.real, i + that.i, j + that.j, k + that.k)
    operator fun times(that:Quaternion):Quaternion {
        return timesR(that.real) + timesI(that.i) + timesJ(that.j) + timesK(that.k)
    }
    operator fun minus(that:Quaternion):Quaternion = Quaternion(real - that.real, i - that.i, j - that.j, k - that.k)
    private fun timesI(value:Double):Quaternion = Quaternion(-i * value, real * value, -k * value, j * value)
    private fun timesJ(value:Double):Quaternion = Quaternion(-j * value, k * value, real * value, -i * value)
    private fun timesK(value:Double):Quaternion = Quaternion(-k * value, -j * value, i * value, real * value)
    private fun timesR(value:Double):Quaternion = Quaternion(real * value, i * value, j * value, k * value)
    companion object {
        fun screwLeft(axis:Vector, radian:Double):Quaternion {
            val normalizedAxis = axis / axis.length * sin(radian / 2)
            return Quaternion(cos(radian / 2), normalizedAxis.x, normalizedAxis.y, normalizedAxis.z)
        }
    }
}
fun conjugate(quaternion: Quaternion):Quaternion {
    return Quaternion(quaternion.real, -quaternion.i, -quaternion.j, -quaternion.k)
}


Measured memory_bytes: 75220