Flatland has recently introduced a new type of an eye check for the driver's licence. The check goes like that: there is a plane with mannequins standing on it. You should tell the value of the minimum angle with the vertex at the origin of coordinates and with all mannequins standing inside or on the boarder of this angle. 

As you spend lots of time "glued to the screen", your vision is impaired. So you have to write a program that will pass the check for you.

Input

The first line contains a single integer n (1 ≤ n ≤ 105) — the number of mannequins.

Next n lines contain two space-separated integers each: xi, yi (|xi|, |yi| ≤ 1000) — the coordinates of the i-th mannequin. It is guaranteed that the origin of the coordinates has no mannequin. It is guaranteed that no two mannequins are located in the same point on the plane.

Output

Print a single real number — the value of the sought angle in degrees. The answer will be considered valid if the relative or absolute error doesn't exceed 10 - 6. 

Examples

Input

2
2 0
0 2


Output

90.0000000000


Input

3
2 0
0 2
-2 2


Output

135.0000000000


Input

4
2 0
0 2
-2 0
0 -2


Output

270.0000000000


Input

2
2 1
1 2


Output

36.8698976458

Note

Solution for the first sample test is shown below: 

<image>

Solution for the second sample test is shown below: 

<image>

Solution for the third sample test is shown below: 

<image>

Solution for the fourth sample test is shown below: 

<image>
import java.io.*;
import java.math.*;
import java.util.*;

/**
 *
 * @author Saju
 *
 */

public class Main {

    private static int dx[] = { 1, 0, -1, 0 };
    private static int dy[] = { 0, -1, 0, 1 };

    private static final long INF = Long.MAX_VALUE;
    private static final int INT_INF = Integer.MAX_VALUE;
    private static final long NEG_INF = Long.MIN_VALUE;
    private static final int NEG_INT_INF = Integer.MIN_VALUE;
    private static final double EPSILON = 1e-10;

    private static final int MAX = 2000007;
    
    private static final long MOD = 1000000007;

    private static final int MAXN = 100007;
    private static final int MAXA = 10000009;
    private static final int MAXLOG = 22;

	public static void main(String[] args) throws IOException {

		InputReader in = new InputReader(System.in);
//		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

//         InputReader in = new InputReader(new FileInputStream("src/test.in"));
//         PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("src/test.out")));

		
		
/*



*/
		int n = in.nextInt();
		Point2D[] points = new Point2D[n];
		
		for(int i = 0; i < n; i++) {
			double x = in.nextDouble();
			double y = in.nextDouble();
			points[i] = new Point2D(x, y);
		}
		
		Point2D p0 = new Point2D(0, 0);
		Point2D pa = new Point2D(10000, 0);
		if(n == 1) {
			System.out.println(getDouble(0.0));
			return;
		}
		
		Arrays.sort(points, p0.POLAR_ORDER);
		
//		for(Point2D point : points) {
//			System.out.println((int)point.x + " " + (int)point.y);
//		}
		
		
//		Point2D pp1 = points[0];
//		Point2D pp2 = points[n - 1];
//
//		double angle1 = angleBetween2Lines(pp1, p0, pp2, p0);
//
//		System.out.println(angle1);
		
		
		List<Double> angles = new ArrayList<>();
		double base = 0.0;
		for(int i = 0; i < n; i++) {
			if(i == n - 1) {
				Point2D p1 = points[i];
				Point2D p2 = points[0];
				double angle = angleBetween2Lines(p1, p0, p2, p0);
				angles.add(angle);
			}
			else {
				Point2D p1 = points[i];
				Point2D p2 = points[i + 1];
				double angle = angleBetween2Lines(p1, p0, p2, p0);
				angles.add(angle);
			}
		}
		
		Collections.sort(angles);
		double sum = 0;
		for(int i = 0; i < angles.size() - 1; i++) {
			sum += angles.get(i);
		}
		
		
//		Point2D p1 = points[0];
//		Point2D p2 = points[1];
//		double angle = getDouble(angleBetween2Lines(p1, p0, p2, p0));
//		
//		double base = getDouble(angleBetween2Lines(p1, p0, pa, p0));
//		base = getDouble(angleBetween2Lines(p2, p0, pa, p0));
//		
//		double sum = angle;
//		double base1 = base;
//		
//		for(int i = 2; i < n; i++) {
//			Point2D p3 = points[i];
//			double top = getDouble(angleBetween2Lines(p2, p0, p3, p0));
//			double bottom = getDouble(360 - angleBetween2Lines(p1, p0, p3, p0));
//			
//			base = getDouble(angleBetween2Lines(p3, p0, pa, p0));
//			
//			if(top < bottom) {
//				p2 = p3;
//				if(base1 != base) {
//					sum += top;
//					base1 = base;
//				}
//				
//			}
//			else {
//				p1 = p3;
//				if(base1 != base) {
//					sum += bottom;
//					base1 = base;
//				}
//				break;
//			}
//			
////			System.out.println(p3 + " " + sum + " " + base);
//			
//		}
		out.println(getDouble(sum));
		
		in.close();
		out.flush();
		out.close();
		System.exit(0);
	}
	
	private static double getDouble(double val) {
//		val = Double.parseDouble(String.format("%.10f", val));
		return val;
	}
	
	public static double angleBetween2Lines(Point2D A1, Point2D A2, Point2D B1, Point2D B2) {
	    double angle1 =  Math.atan2(A2.y - A1.y, A1.x - A2.x);
	    double angle2 = Math.atan2(B2.y - B1.y, B1.x - B2.x);
	    double calculatedAngle = Math.toDegrees(angle1 - angle2);
	    if (calculatedAngle < 0) {
	    	calculatedAngle += 360;
	    }
	    return calculatedAngle;
	}
	
	
	private static class Point2D implements Comparable<Point2D>

	{
		public final Comparator<Point2D> POLAR_ORDER = new PolarOrder();

		private final double x; // x coordinate

		private final double y; // y coordinate

		public Point2D(double x, double y)

		{

			this.x = x;

			this.y = y;

		}

		@Override
		public String toString() {
			return "(" + this.x + ", " + this.y + ")";
		}

		public static int ccw(Point2D a, Point2D b, Point2D c)

		{

//			double area2 = (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);

			double area2 = (a.x * (b.y - c.y)) - (b.x * (a.y - c.y)) + (c.x * (a.y - b.y));
			if (area2 < 0)

				return -1; // c in clockwise of a-b line

			else if (area2 > 0)

				return +1; // c in counter-clockwise of a-b line

			else

				return 0; // c in co-linear of a-b line

		}

		
		public int compareTo(Point2D that)

		{

			if (this.y < that.y)

				return -1;

			if (this.y > that.y)

				return +1;

			if (this.x < that.x)

				return -1;

			if (this.x > that.x)

				return +1;

			return 0;

		}
		private class PolarOrder implements Comparator<Point2D>

		{

			public int compare(Point2D q1, Point2D q2)

			{

				double dx1 = q1.x - x;

				double dy1 = q1.y - y;

				double dx2 = q2.x - x;

				double dy2 = q2.y - y;

				if (dy1 >= 0 && dy2 < 0)

					return -1; // q1 above; q2 below

				else if (dy2 >= 0 && dy1 < 0)

					return +1; // q1 below; q2 above

				else if (dy1 == 0 && dy2 == 0)

				{ // 3-collinear and horizontal

					if (dx1 >= 0 && dx2 < 0)

						return -1;

					else if (dx2 >= 0 && dx1 < 0)

						return +1;

					else

						return 0;

				} else

					return -ccw(Point2D.this, q1, q2); // both above or below

			}

		}

	}
	
	
	
	private static boolean isPalindrome(String str) {
		StringBuilder sb = new StringBuilder();
		sb.append(str);
		String str1 = sb.reverse().toString();
		return str.equals(str1);
	}

	private static String getBinaryStr(int n, int j) {
		String str = Integer.toBinaryString(n);
		int k = str.length();
		for (int i = 1; i <= j - k; i++) {
			str = "0" + str;
		}

		return str;
	}
	
	private static String getBinaryStr(long n, int j) {
		String str = Long.toBinaryString(n);
		int k = str.length();
		for (int i = 1; i <= j - k; i++) {
			str = "0" + str;
		}

		return str;
	}
	
	private static long bigMod(long n, long k, long m) {

        long ans = 1;
        while (k > 0) {
            if ((k & 1) == 1) {
                ans = (ans * n) % m;
            }
            n = (n * n) % m;
            k >>= 1;
        }
        return ans;
    }
    
	private static long ceil(long n, long x) {
		long div = n / x;
        if(div * x != n) {
            div++;
        }
        return div;
	}
	
    private static int ceil(int n, int x) {
        int div = n / x;
        if(div * x != n) {
            div++;
        }
        return div;
    }

    
    private static int abs(int x) {
        if (x < 0) {
            return -x;
        }
        return x;
    }

    private static long abs(long x) {
        if(x < 0) {
            return -x;
        }
        return x;
    }

    private static int lcm(int a, int b) {
        return (a * b) / gcd(a, b);
    }

    private static int gcd(int a, int b) {
        if (a == 0)
            return b;
        return gcd(b % a, a);
    }

    private static int log(long x, int base) {
        return (int) (Math.log(x) / Math.log(base));
    }

    private static long min(long a, long b) {
        if (a < b) {
            return a;
        }
        return b;
    }

    private static int min(int a, int b) {
        if (a < b) {
            return a;
        }
        return b;
    }

    private static long max(long a, long b) {
        if (a < b) {
            return b;
        }
        return a;
    }

    private static int max(int a, int b) {
        if (a < b) {
            return b;
        }
        return a;
    }

    private static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());

                }
            } catch (IOException e) {
                return null;
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
            String line = null;
            try {
                tokenizer = null;
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public boolean hasNext() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (Exception e) {
                return false;
            }
            return true;
        }
        
        public int[] nextIntArr(int n) {
        	int arr[] = new int[n];
    		for(int i = 0; i < n; i++) {
    			arr[i] = nextInt();
    		}
    		return arr;
        }
        
        public long[] nextLongArr(int n) {
        	long arr[] = new long[n];
    		for(int i = 0; i < n; i++) {
    			arr[i] = nextLong();
    		}
    		return arr;
        }
        
        public int[] nextIntArr1(int n) {
        	int arr[] = new int[n + 1];
    		for(int i = 1; i <= n; i++) {
    			arr[i] = nextInt();
    		}
    		return arr;
        }
        
        public long[] nextLongArr1(int n) {
        	long arr[] = new long[n + 1];
    		for(int i = 1; i <= n; i++) {
    			arr[i] = nextLong();
    		}
    		return arr;
        }
       
        public void close() {
        	try {
        		if(reader != null) {
        			reader.close();
        		}
        	}
        	catch(Exception e) {
        		
        	}
        	
        	
        }
    }

}
