#include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;
double PI = acos(-1);

int main(){
  double a,b;
  scanf("%lf %lf",&a,&b);
  a=a/180.0*PI;
  b=b/180.0*PI;
  
  P A=P( cos(a) , sin(a) );
  P B=P( cos(b) , sin(b) );

  
  P C=A+B;
  double ans=arg(C)/PI*180.0;
  while(ans<0)ans+=360.0;
  
  printf("%.8f\n", ans );
  return 0;
}