#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
const double eps = 1e-9;
struct point {
  double x, y;
};
bool comp(double x, double y) {
  if (x + eps < y)
    return true;
  else
    return false;
}
int main(void) {
  vector<point> points[4];
  vector<double> angles[4];
  vector<double> angle;
  const double pi = 3.141592653589;
  int n, i, j;
  cin >> n;
  point tmp;
  for (i = 0; i < n; i++) {
    cin >> tmp.x >> tmp.y;
    if (tmp.x >= 0 && tmp.y > 0) points[0].push_back(tmp);
    if (tmp.x > 0 && tmp.y <= 0) points[1].push_back(tmp);
    if (tmp.x <= 0 && tmp.y < 0) points[2].push_back(tmp);
    if (tmp.x < 0 && tmp.y >= 0) points[3].push_back(tmp);
  }
  for (j = 0; j < 4; j++) angles[j].resize(points[j].size());
  for (i = 0; i < (int)points[0].size(); i++) {
    double cos;
    double x1, y1, x2, y2;
    x1 = 0;
    y1 = 1;
    x2 = points[0][i].x;
    y2 = points[0][i].y;
    cos = (x1 * x2 + y1 * y2) * (x1 * x2 + y1 * y2) /
          ((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2));
    cos = sqrt(cos);
    angles[0][i] = acos(cos);
  }
  for (i = 0; i < (int)points[1].size(); i++) {
    double cos;
    double x1, y1, x2, y2;
    x1 = 1;
    y1 = 0;
    x2 = points[1][i].x;
    y2 = points[1][i].y;
    cos = (x1 * x2 + y1 * y2) * (x1 * x2 + y1 * y2) /
          ((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2));
    cos = sqrt(cos);
    angles[1][i] = acos(cos);
  }
  for (i = 0; i < (int)points[2].size(); i++) {
    double cos;
    double x1, y1, x2, y2;
    x1 = 0;
    y1 = -1;
    x2 = points[2][i].x;
    y2 = points[2][i].y;
    cos = (x1 * x2 + y1 * y2) * (x1 * x2 + y1 * y2) /
          ((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2));
    cos = sqrt(cos);
    angles[2][i] = acos(cos);
  }
  for (i = 0; i < (int)points[3].size(); i++) {
    double cos;
    double x1, y1, x2, y2;
    x1 = -1;
    y1 = 0;
    x2 = points[3][i].x;
    y2 = points[3][i].y;
    cos = (x1 * x2 + y1 * y2) * (x1 * x2 + y1 * y2) /
          ((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2));
    cos = sqrt(cos);
    angles[3][i] = acos(cos);
  }
  for (i = 0; i < (int)angles[0].size(); i++) {
    angle.push_back(angles[0][i] * 180 / pi);
  }
  for (i = 0; i < (int)angles[1].size(); i++) {
    angle.push_back(angles[1][i] * 180 / pi + 90);
  }
  for (i = 0; i < (int)angles[2].size(); i++) {
    angle.push_back(angles[2][i] * 180 / pi + 180);
  }
  for (i = 0; i < (int)angles[3].size(); i++) {
    angle.push_back(angles[3][i] * 180 / pi + 270);
  }
  sort(angle.begin(), angle.end(), comp);
  double ans = 360;
  if (n == 1) {
    printf("0");
    return 0;
  }
  if (n == 2) {
    ans = (angle[1] - angle[0] > 180 + eps ? 360 - (angle[1] - angle[0])
                                           : angle[1] - angle[0]);
    printf("%.10f", ans);
    return 0;
  }
  for (i = 0; i < n - 1; i++) {
    if (360 - (angle[i + 1] - angle[i]) + eps < ans)
      ans = 360 - (angle[i + 1] - angle[i]);
  }
  if (360 - (360 + angle[0] - angle[n - 1]) + eps < ans)
    ans = 360 - (360 + angle[0] - angle[n - 1]);
  printf("%.10f", ans);
  return 0;
}
