#include <bits/stdc++.h>
using namespace std;
double getangle(pair<int, int> a, pair<int, int> b) {}
int main() {
  int n;
  cin >> n;
  double arr[n + 1];
  for (int i = 0; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    arr[i] = atan2(x, y);
    if (arr[i] < 0) arr[i] += 2.0 * M_PI;
    arr[i] *= 180.0 / M_PI;
  }
  sort(arr, arr + n);
  double a = 0.0;
  if (n <= 2)
    a = min(360.0 - (arr[0] - arr[n - 1] + 360.0),
            360.0 - (arr[n - 1] - arr[0]));
  else {
    a = 360.0 - (arr[0] - arr[n - 1] + 360.0);
    for (int i = 0; i < n - 1; ++i) a = min(a, 360.0 - (arr[i + 1] - arr[i]));
  }
  printf("%.8lf\n", a);
}
