#include <bits/stdc++.h>
using std::cin;
using std::cout;
const double PI = 3.14159265358979323846264338327950288;
const double EPS = 1.0E-8;
double angle(const std::pair<int, int>& a, const std::pair<int, int>& b) {
  int v = a.first * b.second - a.second * b.first;
  int s = a.first * b.first + a.second * b.second;
  if (v == 0) {
    return s > 0 ? 0.0 : PI;
  }
  double result = atan2(v, s);
  if (result < 0) {
    result += 2 * PI;
  }
  return result;
}
double findMinAngle(const std::vector<std::pair<int, int> >& pts) {
  if (pts.size() == 1) {
    return 0;
  }
  std::vector<std::tuple<std::pair<int, int>, double> > points(pts.size());
  std::transform(pts.begin(), pts.end(), points.begin(),
                 [](const std::pair<int, int>& point) {
                   return std::tuple<std::pair<int, int>, double>(
                       point, atan2(point.second, point.first));
                 });
  std::sort(points.begin(), points.end(),
            [](const std::tuple<std::pair<int, int>, double>& left,
               const std::tuple<std::pair<int, int>, double>& right) -> bool {
              return std::get<1>(left) < std::get<1>(right) - EPS;
            });
  double result = 2 * PI;
  for (size_t i = 0; i < points.size(); ++i) {
    size_t ni = (i + 1) % points.size();
    double a = angle(std::get<0>(points[i]), std::get<0>(points[ni]));
    result = std::min(result, 2 * PI - a);
  }
  if (fabs(result - 2 * PI) < EPS) {
    result = 0;
  }
  return result * 180.0 / PI;
}
std::vector<std::pair<int, int> > input() {
  int count;
  cin >> count;
  std::vector<std::pair<int, int> > result(count);
  for (int i = 0; i < count; ++i) {
    cin >> result[i].first >> result[i].second;
  }
  return result;
}
void output(double result) {
  cout.precision(10);
  cout << std::fixed << result << '\n';
}
int main() {
  std::ios_base::sync_with_stdio(false);
  output(findMinAngle(input()));
  return 0;
}
