import java.util.Scanner

object Main {
  def solve(sc: => Scanner): Unit = {
    val A, B = sc.nextDouble
    val N = (A - B) / -2 + 360 + A
    println(N % 180)
  }

  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)

    solve(sc)
  }
}