Problem: 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>

Solution (in JAVA):

Solution:
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();
		Point[] points = new Point[n];
		
		for(int i = 0; i < n; i++) {
			double x = in.nextDouble();
			double y = in.nextDouble();
			points[i] = new Point(x, y);
		}
		
		Point p0 = new Point(0, 0);
		if(n == 1) {
			System.out.println(0.0);
			return;
		}
		
		Arrays.sort(points, p0.POLAR_ORDER);
		
//		for(Point point : points) {
//			System.out.println((int)point.x + " " + (int)point.y);
//		}
		
		
		List<Double> angles = new ArrayList<>();
		for(int i = 0; i < n; i++) {
			if(i == n - 1) {
				Point p1 = points[i];
				Point p2 = points[0];
				double angle = angleBetween2Lines(p1, p0, p2, p0);
				angles.add(angle);
			}
			else {
				Point p1 = points[i];
				Point 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);
		}
		
		
		out.println(sum);
		
		in.close();
		out.flush();
		out.close();
		System.exit(0);
	}
	
	public static double angleBetween2Lines(Point p1, Point p2, Point q1, Point q2) {
	    double angle1 =  Math.atan2(p2.y - p1.y, p1.x - p2.x);
	    double angle2 = Math.atan2(q2.y - q1.y, q1.x - q2.x);
	    double calculatedAngle = Math.toDegrees(angle1 - angle2);
	    if (calculatedAngle < 0) {
	    	calculatedAngle += 360;
	    }
	    return calculatedAngle;
	}
	
	
	private static class Point implements Comparable<Point>{
		public final Comparator<Point> POLAR_ORDER = new PolarOrder();

		double x; 
		double y;

		public Point(double x, double y){

			this.x = x;

			this.y = y;

		}

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

		public static int ccw(Point a, Point b, Point c){
			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
			}
		}

		@Override
		public int compareTo(Point 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<Point>{

			@Override
			public int compare(Point q1, Point 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(Point.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) {
        		
        	}
        	
        	
        }
    }

}