Vasya started working in a machine vision company of IT City. Vasya's team creates software and hardware for identification of people by their face.One of the project's know-how is a camera rotating around its optical axis on shooting. People see an eye-catching gadget — a rotating camera — come up to it to see it better, look into it. And the camera takes their photo at that time. What could be better for high quality identification?But not everything is so simple. The pictures from camera appear rotated too (on clockwise camera rotation frame the content becomes rotated counter-clockwise). But the identification algorithm can work only with faces that are just slightly deviated from vertical.Vasya was entrusted to correct the situation — to rotate a captured image so that image would be minimally deviated from vertical. Requirements were severe. Firstly, the picture should be rotated only on angle divisible by 90 degrees to not lose a bit of information about the image. Secondly, the frames from the camera are so huge and FPS is so big that adequate rotation speed is provided by hardware FPGA solution only. And this solution can rotate only by 90 degrees clockwise. Of course, one can apply 90 degrees turn several times but for the sake of performance the number of turns should be minimized.Help Vasya implement the program that by the given rotation angle of the camera can determine the minimum number of 90 degrees clockwise turns necessary to get a picture in which up direction deviation from vertical is minimum.The next figure contains frames taken from an unrotated camera, then from rotated 90 degrees clockwise, then from rotated 90 degrees counter-clockwise. Arrows show direction to "true up".  The next figure shows 90 degrees clockwise turn by FPGA hardware.

The only line of the input contains one integer x ( - 1018 ≤ x ≤ 1018) — camera angle in degrees. Positive value denotes clockwise camera rotation, negative — counter-clockwise.

Output one integer — the minimum required number of 90 degrees clockwise turns.

NoteWhen the camera is rotated 60 degrees counter-clockwise (the second example), an image from it is rotated 60 degrees clockwise. One 90 degrees clockwise turn of the image result in 150 degrees clockwise total rotation and deviation from "true up" for one turn is 150 degrees. Two 90 degrees clockwise turns of the image result in 240 degrees clockwise total rotation and deviation from "true up" for two turns is 120 degrees because 240 degrees clockwise equal to 120 degrees counter-clockwise. Three 90 degrees clockwise turns of the image result in 330 degrees clockwise total rotation and deviation from "true up" for three turns is 30 degrees because 330 degrees clockwise equal to 30 degrees counter-clockwise.From 60, 150, 120 and 30 degrees deviations the smallest is 30, and it it achieved in three 90 degrees clockwise turns.

import java.io.*;
import java.util.*;
public class m {
public static void main(String[] args) throws IOException {
	input.init(System.in);
	PrintWriter out = new PrintWriter(System.out);
	long n = input.nextLong();
	n %= 360;
	if(n < 0) n += 360;
	int res = 0;
	if(n <= 45) res = 0;
	else if(n <= 135) res = 1;
	else if(n <= 225) res = 2;
	else if(n < 315) res = 3;
	out.println(res);
	out.close();
}

public static class input {
	static BufferedReader reader;
	static StringTokenizer tokenizer;

	static void init(InputStream input) {
		reader = new BufferedReader(new InputStreamReader(input));
		tokenizer = new StringTokenizer("");
	}

	static String next() throws IOException {
		while (!tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(reader.readLine());
		return tokenizer.nextToken();
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(next());
	}
}
}

import java.util.*;
public class m {
	public static void main(String[] args){
		Scanner br = new Scanner(System.in);
		long angle = br.nextLong()%360;
		if(angle < 0){
			angle = 360+angle;
		}
		long best = Math.min(angle, 360-angle);
		int bestAns = 0;

		long res1 = Math.min(Math.abs(90-angle), Math.abs(360+90-angle));
		if(res1 < best){
			bestAns = 1;
			best = res1;
		}

		res1 = Math.min(Math.abs(180-angle), Math.abs(360+180-angle));
		if(res1 < best){
			bestAns = 2;
			best = res1;
		}
		res1 = Math.min(Math.abs(270-angle), Math.abs(360+270-angle));
		if(res1 < best){
			bestAns = 3;
			best = res1;
		}

		System.out.println(bestAns);
	}
}

import java.io.*;
import java.util.*;
import java.math.*;

public class BlitzM {

    public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long x = in.nextLong();
		//convert x to be between 0 and 359 degrees
		x = x % 360;
		x += 360;
		x = x % 360;
		if(x>=315 || x<=45)
			System.out.println(0);
		else if(x<=135)
			System.out.println(1);
		else if(x<=225)
			System.out.println(2);
		else
			System.out.println(3);
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class M {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		long x = Long.parseLong(br.readLine());
		x = -x;

		long y = Math.abs(x);

		int z = (int) ((y % 360) * (long) Math.signum(x));

		if (z < 0) {
			z += 360;
		}

		int min = (int) Math.min(Math.abs(z), Math.abs(360 - z));

		int best = 0;

		for (int i = 1; i < 4; i++) {
			z = (z + 90) % 360;
			int m = (int) Math.min(Math.abs(z), Math.abs(360 - z));
			if (m < min) {
				best = i;
				min = m;
			}
		}
		System.out.println(best);

	}

}

import java.math.BigInteger;
import java.util.Scanner;

public class Equation {
    static Scanner scanner = new Scanner(System.in);
    public static void main(String[] args){

        BigInteger inp = scanner.nextBigInteger();
        BigInteger absInp = inp.abs();
        int rotateDirection = inp.compareTo(BigInteger.ZERO);

        int rotation = absInp.mod(BigInteger.valueOf(360L)).intValue();
        if (rotateDirection < 0)
            rotation = - rotation + 360;
        int result;

        if (rotation <= 45 || rotation >= 315)
            result = 0;
        else if (rotation <= 135)
            result = 1;
        else if (rotation <= 225)
            result = 2;
        else
            result = 3;

        System.out.println(result);
    }
}

import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		QuickScanner in = new QuickScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskM solver = new TaskM();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskM {
    public void solve(int testNumber, QuickScanner in, PrintWriter out) {
        long x=in.nextLong();
        x=(x%360+360)%360;
        int res=0;
        long minangl=Math.min(x,360-x);
        for(int i=0;i<4;i++)
        {
            x=(x+270)%360;
            if(Math.min(x,360-x)<minangl)
            {
                minangl=Math.min(x,360-x);
                res=i+1;
            }
        }
        out.println(res);
    }
}

class QuickScanner {
    BufferedReader in;
    StringTokenizer token;
    String delim;
    public QuickScanner(InputStream inputStream)
    {
        this.in=new BufferedReader(new InputStreamReader(inputStream));
        this.delim=" \n\t";
        this.token=new StringTokenizer("",delim);
    }

    public boolean hasNext()
    {
        while(!token.hasMoreTokens())
        {
            try {
                String s=in.readLine();
                if(s==null) return false;
                token=new StringTokenizer(s,delim);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        return true;
    }

    public String next()
    {
        hasNext();
        return token.nextToken();
    }

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

}

import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.io.*;
import java.util.*;

public class EECM
{

private static StringTokenizer st;

    public static void nextLine(BufferedReader br) throws IOException
    {
        st = new StringTokenizer(br.readLine());
    }

    public static int nextInt()
    {
        return Integer.parseInt(st.nextToken());
    }

    public static String next()
    {
        return st.nextToken();
    }

    public static long nextLong()
    {
        return Long.parseLong(st.nextToken());
    }

    public static double nextDouble()
    {
        return Double.parseDouble(st.nextToken());
    }

    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        nextLine(br);
        long x = nextLong() % 360;
        x = -x;
        long[] angles = new long[4];
        for (int i = 0; i < 4; i++)
        {
            angles[i] = dist((x + 90 * i) % 360);
        }
        int best = 0;
        for (int i = 1; i < 4; i++)
        {
            if (angles[i] < angles[best]) best = i;
        }
        System.out.println(best);
    }

    public static long dist(long x)
    {
        x = Math.abs(x);
        return Math.min(x, 360-x);
    }
}

import java.io.*;
import java.util.*;
import java.math.BigInteger;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class Solution extends PrintWriter {

	void run() {
		long rot = -nextLong();
		long a = ((rot % 360) + 360) % 360;

		long b = 360;
		int ans = 0;

		for (int i = 0; i < 4; i++) {
			long c = min(a, 360 - a);
			if (c < b) {
				b = c;
				ans = i;
			}
			a = (a + 90) % 360;
		}

		println(ans);

	}

	int[][] nextMatrix(int n, int m) {
		int[][] matrix = new int[n][m];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < m; j++)
				matrix[i][j] = nextInt();
		return matrix;
	}

	String next() {
		while (!tokenizer.hasMoreTokens())
			tokenizer = new StringTokenizer(nextLine());
		return tokenizer.nextToken();
	}

	boolean hasNext() {
		while (!tokenizer.hasMoreTokens()) {
			String line = nextLine();
			if (line == null) {
				return false;
			}
			tokenizer = new StringTokenizer(line);
		}
		return true;
	}

	int[] nextArray(int n) {
		int[] array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = nextInt();
		}
		return array;
	}

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

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

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

	String nextLine() {
		try {
			return reader.readLine();
		} catch (IOException err) {
			return null;
		}
	}

	public Solution(OutputStream outputStream) {
		super(outputStream);
	}

	static BufferedReader reader;
	static StringTokenizer tokenizer = new StringTokenizer("");
	static Random rnd = new Random();

	public static void main(String[] args) throws IOException {
		Solution solution = new Solution(System.out);
		reader = new BufferedReader(new InputStreamReader(System.in));
		solution.run();
		solution.close();
		reader.close();
	}
}

import java.util.*;
public class ProM {
	static int ans;
	static long x,a,b;

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		x=-in.nextLong();
		b=360;
		for(int i=0;i<=3;i++)
		{
			a=((x+i*90)%360+360)%360;
			a=Math.min(a,360-a);
			if(a<b) { b=a;ans=i;}
		}
		System.out.println(ans);
	}
}

import java.util.*;
public class ProM {
	static int ans;
	static long x,a,b;

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		x=-in.nextLong();
		x=x%360;
		if(x<0) x+=360;
		b=360;
		for(int i=0;i<=3;i++)
		{
			a=(x+i*90)%360;
			a=Math.min(a,360-a);
			if(a<b) { b=a;ans=i;}
		}
		System.out.println(ans);
	}
}

import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long n= in.nextLong();
        long ang = (n % 360 + 360)%360;
        ang = (ang+44)%360;
        System.out.println((int) ang%359/90);
    }
}

import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        long n=sc.nextLong()%360;
        if(n>0&&n>180)
            n=n-360;
        if(n<0&&n<-180)
            n=n+360;
    //    System.out.println(n);
        if(n<=0&&n>=-45)
        {
            System.out.println(0);
        }
        if(n<-45&&n>-135)
        {
            System.out.println(3);
        }
        if(n<=-135&&n>=-180)
        {
            System.out.println(2);
        }
        if(n<=180&&n>135)
        {
            System.out.println(2);
        }
        if(n>45&&n<=135)
        {
            System.out.println(1);
        }
        if(n>0&&n<=45)
        {
            System.out.println(0);
        }

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Andy Phan
 */
public class m {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        System.out.println((((in.nextLong()%360+360+44)%360)%359)/90);

        out.close();
    }

    static class FS {

        BufferedReader in;
        StringTokenizer token;

        public FS(InputStream str) {
            in = new BufferedReader(new InputStreamReader(str));
        }

        public String next() {
            if (token == null || !token.hasMoreElements()) {
                try {
                    token = new StringTokenizer(in.readLine());
                } catch (IOException ex) {
                }
                return next();
            }
            return token.nextToken();
        }

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

import java.util.Scanner;

public class Turn {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();
		a %= 360;
		a += 360;
		a %= 360;

		if (a <= 45 || a >=315) {
			System.out.println(0);
		} else if (a <= 135) {
			System.out.println(1);
		} else if (a <= 225) {
			System.out.println(2);
		} else {
			System.out.println(3);
		}
	}
}

import java.util.Scanner;

public class CF_630M {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long x = scan.nextLong();
		x = -x;
		x = x % 360;
		//System.out.println("=" + x);

		int minDev = 400;
		int ans = 0;
		for(int rot=0;rot<=3;rot++) {
			int dev = (int) Math.min(Math.abs(x-(-360)),Math.min(Math.abs(x-360),Math.abs(x-0)));
			//System.out.println(dev + " in " + rot);
			if(dev < minDev) {
				ans = rot;
				minDev = dev;
			}
			x += 90;
			x = x % 360;
		}
		System.out.println(ans);
	}
}

import java.io.*;
import java.util.StringTokenizer;

public class C {

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

        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int d = (int)((360 - (sc.nextLong()) % 360) % 360);

        int minDev = Math.min(d, 360 - d), ans = 0;
        for(int i = 1; i <= 3; ++i) {
            d = (d + 90) % 360;
            int curDev = Math.min(d, 360 - d);
            if (curDev < minDev) {
                minDev = curDev;
                ans = i;
            }
        }
        out.println(ans);
        out.close();

    }

    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

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

        public String nextLine() throws IOException {return br.readLine();}

        public boolean ready() throws IOException {return br.ready();}

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer buffer;

	public static void solve() {
		long shift = (long)Math.pow(10,18) + 80L;
		int x = 360 - (int)((nl() + shift)%360);
		int[]rot = new int[4];
		for (int i=0;i<4;i++) {
			rot[i] = (x + i*(90))%360;
		}
		int[]dev = new int[4];
		for (int i=0;i<4;i++) {
			dev[i] = Math.min(rot[i], 360-rot[i]);
		}
		int min = 361, ind = -1;
		for (int i=0;i<4;i++) {
			if (dev[i]<min) {
				min = dev[i];
				ind = i;
			}
		}
		out.println(ind);
	}

	public static void main(String[] args) throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	static String next() {
		while (buffer == null || !buffer.hasMoreElements()) {
			try {
				buffer = new StringTokenizer(in.readLine());
			} catch (IOException e) {
			}
		}
		return buffer.nextToken();
	}

	static int ni() {
		return Integer.parseInt(next());
	}

	static long nl() {
		return Long.parseLong(next());
	}

	static double nd() {
		return Double.parseDouble(next());
	}

	static String ns() {
		return next();
	}

	static int[] ni(int n) {
		int[] res = new int[n];
		for (int i = 0; i < n; i++)
			res[i] = Integer.parseInt(next());
		return res;
	}

	static long[] nl(int n) {
		long[] res = new long[n];
		for (int i = 0; i < n; i++)
			res[i] = Long.parseLong(next());
		return res;
	}

	static double[] nd(int n) {
		double[] res = new double[n];
		for (int i = 0; i < n; i++)
			res[i] = Double.parseDouble(next());
		return res;
	}

	static String[] ns(int n) {
		String[] res = new String[n];
		for (int i = 0; i < n; i++)
			res[i] = next();
		return res;
	}

}

import java.util.*;
public class CodeForces
{

    public static void main(String[] args)
	{

            Scanner in = new Scanner(System.in);
            long angle = in.nextLong();
            if(angle < 0 ) angle = 360 - (Math.abs(angle)%360);
            else angle = angle%360;

            if(angle == 0 || angle == 360) System.out.println(0);
            else if( angle <= 45 || angle >= 315) System.out.println(0);
            else if( angle <= 135) System.out.println(1);
            else if( angle <= 225) System.out.println(2);
            else if( angle < 315) System.out.println(3);
        }

}

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
import java.lang.*;

public class Thirteen{
	static long mod=1000000007;

    public static void main(String[] args) throws Exception{
    	 InputReader in = new InputReader(System.in);
    	PrintWriter pw=new PrintWriter(System.out);

    	//int t=in.readInt();
        //	while(t-->0)
        	//{
        	//int n=in.readInt();
    	long n=in.readLong();
    	n=n%360;
    	if(n<0)
    		n+=360;
    	n = (n + 44) % 360;
    	long ans = (n % 359) / 90;

		   pw.println(ans);

    	//}

    	pw.close();
    }

    public static BigInteger fact(int n)
    {
    	BigInteger x=BigInteger.valueOf(1);
    	for(int i=1;i<=n;i++)
    	{
    		x=x.multiply(BigInteger.valueOf(i));
    	}
    	return x;
    }
    /* returns nCr mod m */
   	public static long comb(long n, long r, long m)
   	{
   		long p1 = 1, p2 = 1;
   		for (long i = r + 1; i <= n; i++) {
   			p1 = (p1 * i) % m;
   		}
   		p2 = factMod(n - r, m);
   		p1 = divMod(p1, p2, m);
   		return p1 % m;
   	}
   /* returns a/b mod m, works only if m is prime and b divides a */
   	public static long divMod(long a, long b, long m)
   	{
   		long c = powerMod(b, m - 2, m);
   		return ((a % m) * (c % m)) % m;
   	}
   /* calculates factorial(n) mod m */
   	public static long factMod(long n, long m) {
   		long result = 1;
   		if (n <= 1)
   			return 1;
   		while (n != 1) {
   			result = ((result * n--) % m);
   		}
   		return result;
   	}
   /* This method takes a, b and c as inputs and returns (a ^ b) mod c */
   	public static long powerMod(long a, long b, long c) {
   		long result = 1;
   		long temp = 1;
   		long mask = 1;
   		for (int i = 0; i < 64; i++) {
   			mask = (i == 0) ? 1 : (mask * 2);
   			temp = (i == 0) ? (a % c) : (temp * temp) % c;
   			/* Check if (i + 1)th bit of power b is set */
   			if ((b & mask) == mask) {
   				result = (result * temp) % c;
   			}
   		}
   		return result;
   	}
	static boolean isPrime(int number) {
        if (number <= 1) {
            return false;
        }
        if (number <= 3) {
            return true;
        }
        if (number % 2 == 0 || number % 3 == 0) {
            return false;
        }
        int i = 5;
        while (i * i <= number) {
            if (number % i == 0 || number % (i + 2) == 0) {
                return false;
            }
            i += 6;
        }
        return true;
    }

public static long gcd(long x,long y)
{
	if(x%y==0)
		return y;
	else
		return gcd(y,x%y);
}

public static int gcd(int x,int y)
{
	if(x%y==0)
		return y;
	else
		return gcd(y,x%y);
}
public static int abs(int a,int b)
{
	return (int)Math.abs(a-b);
}
public static long abs(long a,long b)
{
	return (long)Math.abs(a-b);
}
public static int max(int a,int b)
{
	if(a>b)
		return a;
	else
		return b;
}
public static int min(int a,int b)
{
	if(a>b)
		return b;
	else
		return a;
}
public static long max(long a,long b)
{
	if(a>b)
		return a;
	else
		return b;
}
public static long min(long a,long b)
{
	if(a>b)
		return b;
	else
		return a;
}

static boolean isPowerOfTwo (long v) {
	return (v & (v - 1)) == 0;
}
public static long pow(long n,long p,long m)
{
	 long  result = 1;
	  if(p==0)
	    return 1;
	if (p==1)
	    return n;
	while(p!=0)
	{
	    if(p%2==1)
	        result *= n;
	    if(result>=m)
	    result%=m;
	    p >>=1;
	    n*=n;
	    if(n>=m)
	    n%=m;
	}
	return result;
}
public static long pow(long n,long p)
{
	long  result = 1;
	  if(p==0)
	    return 1;
	if (p==1)
	    return n;
	while(p!=0)
	{
	    if(p%2==1)
	        result *= n;
	    p >>=1;
	    n*=n;
	}
	return result;

}
static class Pair implements Comparable<Pair>
{
	int a,b;
	Pair (int a,int b)
	{
		this.a=a;
		this.b=b;
	}

	public int compareTo(Pair o) {
		// TODO Auto-generated method stub
		if(this.a!=o.a)
		return Integer.compare(this.a,o.a);
		else
			return Integer.compare(this.b, o.b);
		//return 0;
	}
	public boolean equals(Object o) {
        if (o instanceof Pair) {
            Pair p = (Pair)o;
            return p.a == a && p.b == b;
        }
        return false;
    }
    public int hashCode() {
        return new Integer(a).hashCode() * 31 + new Integer(b).hashCode();
    }
}

static long sort(int a[],int n)
{  	int b[]=new int[n];
	return mergeSort(a,b,0,n-1);}
static long mergeSort(int a[],int b[],long left,long right)
{ long c=0;if(left<right)
 {   long mid=left+(right-left)/2;
	 c= mergeSort(a,b,left,mid);
	 c+=mergeSort(a,b,mid+1,right);
	 c+=merge(a,b,left,mid+1,right); }
	return c;	 }
static long merge(int a[],int  b[],long left,long mid,long right)
{long c=0;int i=(int)left;int j=(int)mid; int k=(int)left;
while(i<=(int)mid-1&&j<=(int)right)
{ if(a[i]<=a[j]) {b[k++]=a[i++]; }
else	{ b[k++]=a[j++];c+=mid-i;}}
while (i <= (int)mid - 1)   b[k++] = a[i++];
while (j <= (int)right) b[k++] = a[j++];
for (i=(int)left; i <= (int)right; i++)
	a[i] = b[i];  return c;  }

   static  class InputReader
    {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream)
        {
            this.stream = stream;
        }

        public int read()
        {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars)
            {
                curChar = 0;
                try
                {
                    numChars = stream.read(buf);
                } catch (IOException e)
                {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int readInt()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-')
            {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString()
        {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do
            {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
        public double readDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, readInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, readInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
        public long readLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
        public boolean isSpaceChar(int c)
        {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next()
        {
            return readString();
        }

        public interface SpaceCharFilter
        {
            public boolean isSpaceChar(int ch);
        }
    }

     static class OutputWriter
    {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream)
        {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer)
        {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects)
        {
            for (int i = 0; i < objects.length; i++)
            {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects)
        {
            print(objects);
            writer.println();
        }

        public void close()
        {
            writer.close();
        }

        public void flush()
        {
            writer.flush();
        }

    }
    /* USAGE

    //initialize
        InputReader in 		= new InputReader(System.in);
        OutputWriter out	=	new OutputWriter(System.out);

    //read int
    int i = in.readInt();
    //read string
    String s = in.readString();
    //read int array of size N
    int[] x = IOUtils.readIntArray(in,N);
    //printline
    out.printLine("X");

    //flush output
    out.flush();

    //remember to close the
    //outputstream, at the end
    out.close();

    */
  static   class IOUtils {

        public static int[] readIntArray(InputReader in, int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = in.readInt();
            return array;
    }
    }
//BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	//StringBuilder sb=new StringBuilder("");
	 //InputReader in = new InputReader(System.in);
  // OutputWriter out = new OutputWriter(System.out);
	//PrintWriter pw=new PrintWriter(System.out);
	//String line=br.readLine().trim();

	//int t=Integer.parseInt(br.readLine());
  //	while(t-->0)
  	//{
  	//int n=Integer.parseInt(br.readLine());
	//long n=Long.parseLong(br.readLine());
	//String l[]=br.readLine().split(" ");
  //int m=Integer.parseInt(l[0]);
	//int k=Integer.parseInt(l[1]);
	//String l[]=br.readLine().split(" ");
	//l=br.readLine().split(" ");
	/*int a[]=new int[n];
	for(int i=0;i<n;i++)
	{
		a[i]=Integer.parseInt(l[i]);
	}*/
	   //System.out.println(" ");

	//}
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {
	static int deviation(int angle){
		return angle <= 180?angle:360-angle;
	}
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner();
		PrintWriter out = new PrintWriter(System.out);
		long x = -sc.nextLong();
		int angle = (int) ((x % 360 + 360)%360);
		int ans = angle, turns = 0;
		for (int i = 0, j = angle; i < 4; i++, j = (j + 90)%360) {
			if(deviation(ans) > deviation(j)){
				ans = j;
				turns = i;
			}
		}
		out.println(turns);
		out.flush();
		out.close();
	}

	static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		public Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public Scanner(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

	}

}

import java.util.Scanner;

public class M {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		Long n = in.nextLong();
		n = n%360;
		if(n<0){
			n=360+n;
		}
		//System.out.println(n);
		System.out.println(Math.min(Math.round(n/90.0)%4,Math.round(n/90.0-.00000000001)%4));
	}

}

import java.io.*;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Math.*;

public class Main {
    FastScanner in;
    PrintWriter out;

    static final String FILE = "";

    public void solve() {
        long x = in.nextLong();
        x %= 360;
        while (x < 0)
            x += 360;
        x = 360 - x;
        long mini = min(abs(360 - x), x);
        int cnt = 0;
        for (int i = 1; i < 100; i++) {
            x += 90;
            x %= 360;
            long curr = min(abs(360 - x), x);
            if (curr < mini) {
                mini = curr;
                cnt = i;
            }
        }
        out.print(cnt);
    }

    public void run() {
        if (FILE.equals("")) {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);
        } else {
            try {
                in = new FastScanner(new FileInputStream(FILE +
                        ".in"));
                out = new PrintWriter(new FileOutputStream(FILE +
                        ".out"));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }
        solve();
        out.close();
    }

    public static void main(String[] args) {
        (new Main()).run();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
                return "";
            }
        }

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

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

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

        public float nextFloat() {
            return Float.parseFloat(next());
        }
    }

    class Pair<A extends Comparable<A>, B extends Comparable<B>>
            implements Comparable<Pair<A, B>> {
        public A a;
        public B b;

        public Pair(A a, B b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public int compareTo(Pair<A, B> o) {
            if (o == null || o.getClass() != getClass())
                return 1;
            int cmp = a.compareTo(o.a);
            if (cmp == 0)
                return b.compareTo(o.b);
            return cmp;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair<?, ?> pair = (Pair<?, ?>) o;

            if (a != null ? !a.equals(pair.a) : pair.a != null) return
                    false;
            return !(b != null ? !b.equals(pair.b) : pair.b != null);
        }
    }

    class PairInt extends Pair<Integer, Integer> {
        public PairInt(Integer u, Integer v) {
            super(u, v);
        }
    }

    class PairLong extends Pair<Long, Long> {
        public PairLong(Long u, Long v) {
            super(u, v);
        }
    }

}

import java.io.*;
import java.util.*;
import java.math.*;

public class M {

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

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

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

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

    static InputReader r = new InputReader(System.in);
    static PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {

        ArrayList<int[]> list = new ArrayList<int[]>();

        long k = r.nextLong();
        int x = (int)(k % 360);
        list.add(new int[]{0, Math.min(Math.min(Math.abs(x), Math.abs(x-360)), Math.abs(x+360))});

        for(int i = 1; i <= 3; i++){
            x -= 90;
            x %= 360;
            list.add(new int[]{i, Math.min(Math.min(Math.abs(x), Math.abs(x-360)), Math.abs(x + 360))});
        }

        Collections.sort(list, new Sort());
        /*
        for(int[] arr : list){
            System.out.println(Arrays.toString(arr));
        }
        */
        System.out.println(list.get(0)[0]);

        pw.close();
    }

    static class Sort implements Comparator<int[]>{
        public int compare(int[] a, int[] b){
            if(a[1] == b[1]){
                return a[0] - b[0];
            } else{
                return a[1] - b[1];
            }
        }
    }
}

/**
*                _        _                 _
*               | |      | |               | |
*   ___ ___   __| | ___  | |__  _   _    __| | __ _ _ __ _ __ ___ _ __     _   _  __ _  ___
*  / __/ _ \ / _` |/ _ \ | '_ \| | | |  / _` |/ _` | '__| '__/ _ \ '_ \   | | | |/ _` |/ _ \
* | (_| (_) | (_| |  __/ | |_) | |_| | | (_| | (_| | |  | | |  __/ | | |  | |_| | (_| | (_) |
*  \___\___/ \__,_|\___| |_.__/ \__, |  \__,_|\__,_|_|  |_|  \___|_| |_|   \__, |\__,_|\___/
*                                __/ |                               ______ __/ |
*                               |___/                               |______|___/
 */

import java.util.*;
import java.io.*;
import java.math.BigInteger;
/*
3
24

1 1 5 5
 */
public class a
{
	public static void main(String[] arg) throws IOException
	{
		new a();
	}
	public a() throws IOException
	{
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		double angle = (in.nextLong()%360+360)%360;
		angle = angle+44;
		angle %= 359;
		if(angle <= 89) out.println(0);
		else if(angle <= 179) out.println(1);
		else if(angle <= 269) out.println(2);
		else if(angle <= 358) out.println(3);
		in.close(); out.close();
	}

	public long pow(long base, long exp)
	{
		if(exp == 0) return 1;
		if((exp&1) == 1) return base*pow(base, exp-1)%100000;
		long ret = pow(base, exp/2)%100000;
		return ret*ret%100000;
	}
	public long choose(long n, long k)
	{
		if(k == 0)
			return 1;
		return choose(n, k-1)*(n-k+1)/k;
	}
	long gcd(long a, long b)
	{
		return b == 0 ? a:gcd(b, a%b);
	}
	class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(InputStream in)
		{
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}
		public String next() throws IOException
		{
			while(!st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public void close() throws IOException
		{
			br.close();
		}
	}
}

import java.io.*;

public class CF630M {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		long x = Long.parseLong(br.readLine());
		x = x - (x / 360) * 360;
		if (x < 0)
			x += 360;
		int m;
		if (x <= 45 || x >= 315)
			m = 0;
		else if (x <= 135)
			m = 1;
		else if (x <= 225)
			m = 2;
		else
			m = 3;
		System.out.println(m);
	}
}

import java.util.Scanner;

public class Turn {

	public static void main(String[] args) {
		Scanner s=new Scanner(System.in);
		long angle=s.nextLong();
		angle=(angle+44)%360;
		if(angle<0){
			angle=360+angle;
		}
		if(angle>=0 && angle<=89){
			System.out.println("0");
		}
		else if(angle>=90 && angle<=179){
			System.out.println("1");
		}
		else if(angle>=180 && angle<=269){
			System.out.println("2");
		}
		else if(angle>=270 && angle<=358){
			System.out.println("3");
		}
		else if(angle==359){
			System.out.println("0");
		}
	}
}

import java.io.*;
import java.util.InputMismatchException;

public class EERK {
    private static InputReader in = new InputReader(System.in);
    private static OutputWriter out = new OutputWriter(System.out);

    private static void solve() throws Exception {
        long n = in.readLong();
        n = n%360;
        if(n==0){
            out.println(0);
        }
        else{
            n = -n;
            if(n<0){
                n = n+360;
            }
            int count = 0;
            while((n>45)&&(n<315)){
                n = n+90;
                count++;
            }
            out.println(count);
        }
    }

    public static void main(String[] args) throws Exception {
        solve();
        out.close();
    }

    private static class InputReader {
        private InputStream stream;
        private byte[] buffer;
        private int currentIndex;
        private int bytesRead;

        public InputReader(InputStream stream) {
            this.stream = stream;
            buffer = new byte[131072];
        }

        public InputReader(InputStream stream, int bufferSize) {
            this.stream = stream;
            buffer = new byte[bufferSize];
        }

        private int read() throws IOException {
            if (currentIndex >= bytesRead) {
                currentIndex = 0;
                bytesRead = stream.read(buffer);
                if (bytesRead <= 0) {
                    return -1;
                }
            }
            return buffer[currentIndex++];
        }

        public String readString() throws IOException {
            int c = read();
            while (!isPrintable(c)) {
                c = read();
            }
            StringBuilder result = new StringBuilder();
            do {
                result.appendCodePoint(c);
                c = read();
            } while (isPrintable(c));
            return result.toString();
        }

        public int readInt() throws Exception {
            int c = read();
            int sign = 1;
            while (!isPrintable(c)) {
                c = read();
            }
            if (c == '-') {
                sign = -1;
                c = read();
            }
            int result = 0;
            do {
                if ((c < '0') || (c > '9')) {
                    throw new InputMismatchException();
                }
                result *= 10;
                result += (c - '0');
                c = read();
            } while (isPrintable(c));
            return sign * result;
        }

        public long readLong() throws Exception {
            int c = read();
            int sign = 1;
            while (!isPrintable(c)) {
                c = read();
            }
            if (c == '-') {
                sign = -1;
                c = read();
            }
            long result = 0;
            do {
                if ((c < '0') || (c > '9')) {
                    throw new InputMismatchException();
                }
                result *= 10;
                result += (c - '0');
                c = read();
            } while (isPrintable(c));
            return sign * result;
        }

        public double readDouble() throws Exception {
            int c = read();
            int sign = 1;
            while (!isPrintable(c)) {
                c = read();
            }
            if (c == '-') {
                sign = -1;
                c = read();
            }
            boolean fraction = false;
            double multiplier = 1;
            double result = 0;
            do {
                if ((c == 'e') || (c == 'E')) {
                    return sign * result * Math.pow(10, readInt());
                }
                if ((c < '0') || (c > '9')) {
                    if ((c == '.') && (!fraction)) {
                        fraction = true;
                        c = read();
                        continue;
                    }
                    throw new InputMismatchException();
                }
                if (fraction) {
                    multiplier /= 10;
                    result += (c - '0') * multiplier;
                    c = read();
                } else {
                    result *= 10;
                    result += (c - '0');
                    c = read();
                }
            } while (isPrintable(c));
            return sign * result;
        }

        private boolean isPrintable(int c) {
            return ((c > 32) && (c < 127));
        }
    }

    private static class OutputWriter {
        private PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void flush() {
            writer.flush();
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Egor Kulikov (egor@egork.net)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskM solver = new TaskM();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskM {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            long x = -in.readLong();
            x %= 360;
            if (x < 0) {
                x += 360;
            }
            long best = 0;
            long angle = Integer.MAX_VALUE;
            for (int i = 0; i < 4; i++) {
                long candidate = Math.min(x, 360 - x);
                if (candidate < angle) {
                    angle = candidate;
                    best = i;
                }
                x += 90;
                x %= 360;
            }
            out.printLine(best);
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(long i) {
            writer.println(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public long readLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.util.ArrayList;
import java.util.Scanner;

public class UpSolve {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner input= new Scanner(System.in);
		long n = input.nextLong();
		n = n + 3600000000000000000l;
		ArrayList<Integer> output =new ArrayList<Integer>();
		int min = 4000;
		for(int b = 0; b < 360; b+= 90){
			output.add(deviation(n-b));
		}
		int count = 0;
		int countId = 0;
		for(Integer d:output){
			if(min > d){
				min = d;
				countId = count;
			}
			count++;
		}
		System.out.println(countId);
	}
	public static int deviation(long n){
		int k = (int)(n%360);
		if(k > 180){
			k = 360 - k;
		}
		return k;
	}
}

import java.util.*;
public class Turn {

	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);
		long n = input.nextLong();
		n = n % 360;
		if (n < 0)
		{
			n += 360;
		}
		if (n <= 45 || n >= 315)
		{
			System.out.println(0);
		}
		else if (n <= 135)
		{
			System.out.println(1);
		}
		else if (n <= 225)
		{
			System.out.println(2);
		}
		else
		{
			System.out.println(3);
		}
	}

}

import java.util.*;
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner in = new Scanner(System.in);
		long n = -in.nextLong();
		n=((n%360)+360)%360;
		int ans = 987654321;
		int out = -1;
		for(int i = 0; i < 4; i ++)
		{
			int test = Math.min(360-(int)n, (int)n);
			if (test < ans)
			{
				ans = test;
				out = i;
			}
			n = (n+90)%360;
		}
		System.out.println(out);
	}
}

import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author Madi
 */
public class M630 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long x = sc.nextLong();

        x = -x;
        x %= 360;

        if (x < 0) {
            x += 360;
        }

        long min = Long.MAX_VALUE;
        if (x < 180) {
            if (x < min) {
                min = x;
            }
        } else {
            if (360 - x < min) {
                min = 360 - x;
            }
        }

        int minind = 0;
        for (int i = 1; i < 5; i++) {
            x += 90;
            x %= 360;
            if (x < 180) {
                if (x < min) {
                    min = x;
                    minind = i;
                }
            } else {
                if (360 - x < min) {
                    min = 360 - x;
                    minind = i;
                }
            }
        }

        System.out.println(minind % 4);
    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Main
{
	static long quick(long a, long b)
	{
		long ans=1L;
		while(b!=0)
	    {
	        if((b%2)!=0)
	            ans*=a;
	        b/=2;
	        a*=a;
	    }
	    return ans;
	}
	public static void main(String[] args)
	{
		InputReader in = new InputReader();
//		Scanner in=new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		while(in.hasNext())
		{
			long n=in.nextLong();
			n%=360;
			if(n<-45)n+=360;
			if(n>=315)n-=360;
			out.println((n+44)/90);
		}
		out.close();
	}
}

class InputReader
{
	BufferedReader buf;
	StringTokenizer tok;
	InputReader()
	{
		buf = new BufferedReader(new InputStreamReader(System.in));
	}

	boolean hasNext()
	{
		while (tok == null || !tok.hasMoreElements())
		{
			try
			{
				tok = new StringTokenizer(buf.readLine());
			}
			catch (Exception e)
			{
				return false;
			}
		}
		return true;
	}

	String next()
	{
		if (hasNext())
			return tok.nextToken();
		return null;
	}

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

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

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

	BigInteger nextBigInteger()
	{
		return new BigInteger(next());
	}

	BigDecimal nextBigDecimal()
	{
		return new BigDecimal(next());
	}
}

import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;
import java.io.BufferedWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.IOException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Alex
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskM solver = new TaskM();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskM {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            long input = -1 * in.readLong();
            int start = (int) (input % 360);
            int abs = start;
            if(abs < 0) abs += 360;
            int best = Math.min(Math.abs(abs), 360 - Math.abs(abs)), bestturns = 0;
            for(int turns = 1; turns < 10000; turns++) {
                start += 90;
                start %= 360;

                abs = start;
                if(abs < 0) abs += 360;
                int val = Math.min(Math.abs(abs), 360 - Math.abs(abs));
//            if (turns < 10) {
//                out.printLine(turns, start, abs, val);
//            }
                if(val < best) {
                    best = val;
                    bestturns = turns;
                }
            }
            out.printLine(bestturns);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if(numChars == -1)
                throw new InputMismatchException();
            if(curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch(IOException e) {
                    throw new InputMismatchException();
                }
                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public long readLong() {
            int c = read();
            while(isSpaceChar(c))
                c = read();
            int sgn = 1;
            if(c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if(c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while(!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if(filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    public static void main(String[] args) {
//     Test.testing();
        ConsoleIO io = new ConsoleIO();
        new Main(io).solve();
        io.flush();
    }
    ConsoleIO io;
    Main(ConsoleIO io) {
        this.io = io;
    }

    ArrayList<ArrayList<Integer>> gr1;
    boolean[] visit;
    //

    class Pair{
        public Pair(int a, int b){
            this.a = a;
            this.b = b;
        }
        public int a;
        public int b;
    }

    class Edge {
        public Edge(int c, int u,int v) {
            this.u = u;
            this.v = v;
            this.c = c;
        }
        public int u;
        public int v;
        public int c;
    }

    long MOD = 1_000_000_007;
    int n,m,k,fn;
    int[][] map;
    public void solve() {
        int n = (int)(-io.readLong()%360);
        if(n<0)n = 360+n;
        int v = 0;
        if(n>45 && n<135)v=3;
        if(n>=135 && n<225)v=2;
        if(n>=225 && n<315)v=1;
io.writeLine(v+"");
    }

    long gcd(long a, long b) {
        if (a < b) return gcd(b, a);
        if (b == 0) return a;
        return gcd(b, a % b);
    }
}

class ConsoleIO {
    BufferedReader br;
    PrintWriter out;
    public ConsoleIO(){br = new BufferedReader(new InputStreamReader(System.in));out = new PrintWriter(System.out);}
    public void flush(){this.out.close();}
    public void writeLine(String s) {this.out.println(s);}
    public void writeInt(int a) {this.out.print(a);this.out.print(' ');}
    public void writeWord(String s){
        this.out.print(s);
    }
    public String readLine() {try {return br.readLine();}catch (Exception ex){ return "";}}
    public long readLong() {
        return Long.parseLong(this.readLine());
    }
    public int readInt() {
        return Integer.parseInt(this.readLine().trim());
    }
    public long[] readLongArray() {
        String[]n=this.readLine().trim().split(" ");long[]r=new long[n.length];
        for(int i=0;i<n.length;i++)r[i]=Long.parseLong(n[i]);
        return r;
    }
    public int[] readIntArray() {
        String[]n=this.readLine().trim().split("\\s+");int[]r=new int[n.length];
        for(int i=0;i<n.length;i++)r[i]=Integer.parseInt(n[i]);
        return r;
    }
    public void writeIntArray(int[] a) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < a.length; i++) {if (i > 0) sb.append(' ');sb.append(a[i]);}
        this.writeLine(sb.toString());
    }
}

import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	static long x;

	public static void main(String[] args) {
		x = sc.nextLong();

		x = x % 360;

		if (x >= 0 && x <= 45) {System.out.println(0); return;}
		if (x > 45 && x <= 135) {System.out.println(1); return;}
		if (x > 135 && x <= 225) {System.out.println(2); return;}
		if (x > 225 && x < 315) {System.out.println(3); return;}
		if (x >= 315) {System.out.println(0); return;}

		if (x <= 0 && x >= -45) {System.out.println(0); return;}
		if (x < -45 && x > -135) {System.out.println(3); return;}
		if (x <= -135 && x > -225) {System.out.println(2); return;}
		if (x <= -225 && x > - 315) {System.out.println(1); return;}
		if (x <= -315 && x > -360) {System.out.println(0); return;}
	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author anand.oza
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        MTurn solver = new MTurn();
        solver.solve(1, in, out);
        out.close();
    }

    static class MTurn {
        NumberTheory.ModM mod = new NumberTheory.ModM(360);

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long x = in.nextLong();
            x = -x;
            x = mod.normalize(x);

            int min = 1000;
            int answer = -1;
            for (int i = 0; i <= 3; i++) {
                int cost = (int) Math.min(x, 360 - x);
                if (cost < min) {
                    min = cost;
                    answer = i;
                }
                x = mod.add(x, 90);
            }
            out.println(answer);
        }

    }

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

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

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }

    static class NumberTheory {
        public abstract static class Modulus<M extends NumberTheory.Modulus<M>> {
            ArrayList<Long> factorial = new ArrayList<>();
            ArrayList<Long> invFactorial = new ArrayList<>();

            public abstract long modulus();

            public Modulus() {
                super();
                factorial.add(1L);
                invFactorial.add(1L);
            }

            public long normalize(long x) {
                x %= modulus();
                if (x < 0)
                    x += modulus();
                return x;
            }

            public long add(long a, long b) {
                long v = a + b;
                return v < modulus() ? v : v - modulus();
            }

        }

        public static class ModM extends NumberTheory.Modulus<NumberTheory.ModM> {
            private final long modulus;

            public ModM(long modulus) {
                this.modulus = modulus;
            }

            public long modulus() {
                return modulus;
            }

        }

    }
}

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 *
 * @author pttrung
 */
public class M_Volbit {

	public static long MOD = 1000000007;

	public static void main(String[] args) throws FileNotFoundException {
		// PrintWriter out = new PrintWriter(new FileOutputStream(new File(
		// "output.txt")));
		PrintWriter out = new PrintWriter(System.out);
		Scanner in = new Scanner();
		long v = in.nextLong();
		v %= 360;
		v = cal(v);
		//System.out.println(v);
		long min = Math.abs(v);
		int re = 0;
		for (int i = 0; i < 4; i++) {
			v = (v - 90) % 360;
			v = cal(v);
			//System.out.println(v);
			if (Math.abs(v) < min) {
				min = Math.abs(v);
				re = i + 1;
			}
		}
		// System.out.println(min);
		out.println(re);

		out.close();
	}

	public static long cal(long v) {
		if (v < -180) {
			v = 360 + v;
		}else if(v > 180){
			v -= 360;
		}
		return v;
	}

	public static int[] KMP(String val) {
		int i = 0;
		int j = -1;
		int[] result = new int[val.length() + 1];
		result[0] = -1;
		while (i < val.length()) {
			while (j >= 0 && val.charAt(j) != val.charAt(i)) {
				j = result[j];
			}
			j++;
			i++;
			result[i] = j;
		}
		return result;

	}

	public static boolean nextPer(int[] data) {
		int i = data.length - 1;
		while (i > 0 && data[i] < data[i - 1]) {
			i--;
		}
		if (i == 0) {
			return false;
		}
		int j = data.length - 1;
		while (data[j] < data[i - 1]) {
			j--;
		}
		int temp = data[i - 1];
		data[i - 1] = data[j];
		data[j] = temp;
		Arrays.sort(data, i, data.length);
		return true;
	}

	public static int digit(long n) {
		int result = 0;
		while (n > 0) {
			n /= 10;
			result++;
		}
		return result;
	}

	public static double dist(long a, long b, long x, long y) {
		double val = (b - a) * (b - a) + (x - y) * (x - y);
		val = Math.sqrt(val);
		double other = x * x + a * a;
		other = Math.sqrt(other);
		return val + other;

	}

	public static class Point implements Comparable<Point> {

		int x, y;

		public Point(int start, int end) {
			this.x = start;
			this.y = end;
		}

		@Override
		public int hashCode() {
			int hash = 5;
			hash = 47 * hash + this.x;
			hash = 47 * hash + this.y;
			return hash;
		}

		@Override
		public boolean equals(Object obj) {
			if (obj == null) {
				return false;
			}
			if (getClass() != obj.getClass()) {
				return false;
			}
			final Point other = (Point) obj;
			if (this.x != other.x) {
				return false;
			}
			if (this.y != other.y) {
				return false;
			}
			return true;
		}

		@Override
		public int compareTo(Point o) {
			return x - o.x;
		}
	}

	public static class FT {

		long[] data;

		FT(int n) {
			data = new long[n];
		}

		public void update(int index, long value) {
			while (index < data.length) {
				data[index] += value;
				index += (index & (-index));
			}
		}

		public long get(int index) {
			long result = 0;
			while (index > 0) {
				result += data[index];
				index -= (index & (-index));
			}
			return result;

		}
	}

	public static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	public static long pow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b == 1) {
			return a;
		}
		long val = pow(a, b / 2);
		if (b % 2 == 0) {
			return val * val % MOD;
		} else {
			return val * (val * a % MOD) % MOD;

		}
	}

	static class Scanner {

		BufferedReader br;
		StringTokenizer st;

		public Scanner() throws FileNotFoundException {
			// System.setOut(new PrintStream(new
			// BufferedOutputStream(System.out), true));
			br = new BufferedReader(new InputStreamReader(System.in));
			// br = new BufferedReader(new InputStreamReader(new
			// FileInputStream(new File("input.txt"))));
		}

		public String next() {

			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					throw new RuntimeException();
				}
			}
			return st.nextToken();
		}

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

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

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

		public String nextLine() {
			st = null;
			try {
				return br.readLine();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}

		public boolean endLine() {
			try {
				String next = br.readLine();
				while (next != null && next.trim().isEmpty()) {
					next = br.readLine();
				}
				if (next == null) {
					return true;
				}
				st = new StringTokenizer(next);
				return st.hasMoreTokens();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	public static void main(String args[]) {
		InputStream intputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(intputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskM solver = new TaskM();
		solver.solve(in, out);
		out.close();
	}

	static class TaskM {
		public void solve(InputReader in, PrintWriter out) {
			long x = in.nextLong();
			int ans = 0;
			long res = 360;
			long b = x % 360;
			if (b < -180) {
				b = 360 + b;
			}
			if (b > 180) {
				b = b - 360;
			}
			for (int i = 0; i < 4; ++i) {
				if (Math.abs(b) < res) {
					ans = i;
					res = Math.abs(b);
				}
				b -= 90;
				if (b < -180) {
					b = 360 + b;
				}
			}
			out.println(ans);
		}
	}

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

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

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

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

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

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

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				return null;
			}
		}
	}
}

import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Moda {

    public static long abs(long a) {
        if(a < 0) a = -a;
        return a;
    }

    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long x = sc.nextLong();
        x %= 360;
        x = -x;
        if(x < 0)
            x += 360;
        int best = 360, k = -1;
        if (Math.min(x, 360 - x) < best) {
            best = (int) Math.min(x, 360 - x);
            k = 0;
        }
        for (int i = 1; i <= 3; ++i) {
            x += 90;
            x %= 360;
            if(Math.min(x, 360 - x) < best) {
                best = (int) Math.min(x, 360 - x);
                k = i;
            }
        }
        System.out.printf("%d\n", k);
    }
}

import java.util.*;
public class Turn {
		static int ans;
		static long x,a,b;
	public static void main(String[] args) {
		Scanner kbd=new Scanner(System.in);
		x = -kbd.nextLong();
		b = 360;
		for(int i=0;i<=3;i++){
			a=((x+i*90)%360+360)%360;
			a=Math.min(a,360-a);
			if(a<b) { b=a;ans=i;}
		}
		System.out.println(ans);
	}
}

//package que_b;

import java.io.*;
import java.util.*;
import java.math.*;

public class utkarsh {

    InputStream is;
    PrintWriter out;

    long mod = (long) (1e9 + 7), inf = (long) (3e18);
    boolean SHOW_TIME, debug;

    void solve() {
        //Enter code here utkarsh
        //SHOW_TIME = true;
	//debug = true;
        long x = nl();
        x = -x;
        x = (x % 360 + 360) % 360;
        int ans = 0;
        long y = Math.min(x, 360 - x);
        x = (x + 90) % 360;
        long t = Math.min(x, 360 - x);
        if(t < y) {
            y = t;  ans = 1;
        }
        x = (x + 90) % 360;
        t = Math.min(x, 360 - x);
        if(t < y) {
            y = t;  ans = 2;
        }
        x = (x + 90) % 360;
        t = Math.min(x, 360 - x);
        if(t < y) {
            y = t;  ans = 3;
        }
        out.println(ans);
    }

    long mp(long b, long e) {
        long r = 1;
        while(e > 0) {
            if((e&1) == 1)  r = (r * b) % mod;
            b = (b * b) % mod;
            e >>= 1;
        }
        return r;
    }

    //---------- I/O Template ----------

    public static void main(String[] args) { new utkarsh().run(); }
    void run() {
        is = System.in;
        out = new PrintWriter(System.out);
        long start = System.currentTimeMillis();
        solve();
        long end = System.currentTimeMillis();
        if(SHOW_TIME) out.println("\n" + (end - start) + " ms");
        out.flush();
    }

    byte input[] = new byte[1024];
    int len = 0, ptr = 0;

    int readByte() {
        if(ptr >= len) { ptr = 0;
            try { len = is.read(input); }
            catch(IOException e) { throw new InputMismatchException(); }
            if(len <= 0) { return -1; }
        } return input[ptr++];
    }
    boolean isSpaceChar(int c) { return !( c >= 33 && c <= 126 ); }
    int skip() {
        int b = readByte();
        while(b != -1 && isSpaceChar(b)) { b = readByte(); }
        return b;
    }

    char nc() { return (char)skip(); }
    String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!isSpaceChar(b)) { sb.appendCodePoint(b); b = readByte(); }
        return sb.toString();
    }
    String nLine() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while( !(isSpaceChar(b) && b != ' ') ) { sb.appendCodePoint(b); b = readByte(); }
        return sb.toString();
    }
    int ni() {
        int n = 0, b = readByte();
        boolean minus = false;
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); }
        if(b == '-') { minus = true; b = readByte(); }
        if(b == -1) { return -1; }  //no input
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); }
        return minus ? -n : n;
    }
    long nl() {
        long n = 0L;    int b = readByte();
        boolean minus = false;
        while(b != -1 && !( (b >= '0' && b <= '9') || b == '-')) { b = readByte(); }
        if(b == '-') { minus = true; b = readByte(); }
        while(b >= '0' && b <= '9') { n = n * 10 + (b - '0'); b = readByte(); }
        return minus ? -n : n;
    }

    double nd() { return Double.parseDouble(ns()); }
    float nf() { return Float.parseFloat(ns()); }
    int[] na(int n) {
        int a[] = new int[n];
        for(int i = 0; i < n; i++) { a[i] = ni(); }
        return a;
    }
    char[] ns(int n) {
        char c[] = new char[n];
        int i, b = skip();
        for(i = 0; i < n; i++) {
            if(isSpaceChar(b)) { break; }
            c[i] = (char)b; b = readByte();
        } return i == n ? c : Arrays.copyOf(c,i);
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class M {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		long x = Long.parseLong(br.readLine());
		x = -x;

		long y = Math.abs(x);

		int z = (int) ((y % 360) * (long) Math.signum(x));

		int min = (int) Math.min(Math.abs(z), Math.abs(360 - z));
		int best = 0;

		for (int i = 1; i < 4; i++) {
			z = (z + 90 + 360) % 360;
			int m = (int) Math.min(Math.abs(z), Math.abs(360 - z));
			if (m < min) {
				best = i;
				min = m;
			}
		}
		System.out.println(best);

	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class M {

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		long x = Long.parseLong(br.readLine());

		long y = Math.abs(x);

		int z = (int) ((y % 360) * (long) Math.signum(x));

		int min = (int) Math.min(Math.abs(z), Math.abs(360 - z));
		int best = 0;

		for (int i = 1; i < 4; i++) {
			z = (z + 90 + 360) % 360;
			int m = (int) Math.min(Math.abs(z), Math.abs(360 - z));
			if (m < min) {
				best = i;
				min = m;
			}
		}
		System.out.println(best);

	}

}

import java.math.BigInteger;
import java.util.Scanner;

public class Equation {
    static Scanner scanner = new Scanner(System.in);
    public static void main(String[] args){

        BigInteger inp = scanner.nextBigInteger();
        BigInteger absInp = inp.abs();
        int rotateDirection = inp.compareTo(BigInteger.ZERO);

        int rotation = absInp.mod(BigInteger.valueOf(360L)).intValue();
        if (rotateDirection < 0)
            rotation = - rotation + 360;
        int result;

        if (rotation <= 45)
            result = 0;
        else if (rotation <= 135)
            result = 1;
        else if (rotation <= 225)
            result = 2;
        else
            result = 3;

        System.out.println(result);
    }
}

import java.util.*;
public class ProM {
	static int a,b,c,ans;
	static long x;

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		x=-in.nextLong();
		a=(int)x%360;
		if(a<0) a+=360;
		c=360;
		for(int i=0;i<=3;i++)
		{
			b=(a+i*90)%360;
			b=Math.min(b,360-b);
			if(b<c) { c=b;ans=i;}
		}
		System.out.println(ans);
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Andy Phan
 */
public class m {
    public static void main(String[] args) {
        FS in = new FS(System.in);
        PrintWriter out = new PrintWriter(System.out);

        System.out.println((((in.nextInt()%360+360)%360)%359)/90);

        out.close();
    }

    static class FS {

        BufferedReader in;
        StringTokenizer token;

        public FS(InputStream str) {
            in = new BufferedReader(new InputStreamReader(str));
        }

        public String next() {
            if (token == null || !token.hasMoreElements()) {
                try {
                    token = new StringTokenizer(in.readLine());
                } catch (IOException ex) {
                }
                return next();
            }
            return token.nextToken();
        }

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

import java.util.Scanner;

public class Turn {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();

		if (a > 0) {
			System.out.println((a + 45) / 90);
		} else if (a < 0) {
			System.out.println(3 * -(a - 45) / 90);
		} else {
			System.out.println(0);
		}
	}
}

import java.util.Scanner;

public class Turn {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();
		a %= 360;
		if (a > 180) {
			a -= 360;
		} else if (a < -180) {
			a += 360;
		}

		if (a > 0) {
			if ((a + 45) % 90 == 0) {
				System.out.println((a + 45) / 90 - 1);
			} else {
				System.out.println((a + 45) / 90);
			}
		} else if (a < 0) {
			if ((a + 45) % 90 == 0) {
				System.out.println(3 * -(a - 45) / 90 - 3);
			} else {
				System.out.println(3 * -(a - 45) / 90);
			}
		} else {
			System.out.println(0);
		}
	}
}

import java.util.Scanner;

public class Turn {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();

		if (a > 0) {
			System.out.println((a + 44.99999999) / 90);
		} else if (a < 0) {
			System.out.println(3 * -(a - 44.999999999) / 90);
		} else {
			System.out.println(0);
		}
	}
}

import java.util.Scanner;

public class Turn {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();
		a %= 360;
		a += 360;
		a %= 360;

		if (a <= 45 || a >=315) {
			System.out.println(0);
		} else if (a > 45) {
			System.out.println(1);
		} else if (a > 135) {
			System.out.println(2);
		} else if (a > 225) {
			System.out.println(3);
		}
	}
}

import java.util.Scanner;

public class Turn {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();

		if (a > 0) {
			if ((a + 45) % 90 == 0) {
				System.out.println(((a + 45) / 90) % 4);
			} else {
				System.out.println((a + 45) / 90 % 4);
			}
		} else if (a < 0) {
			if ((a - 45) % 90 == 0) {
				System.out.println((3 * -(a - 45) / 90 - 3) % 4);
			} else {
				System.out.println((3 * -(a - 45) / 90) % 4);
			}
		} else {
			System.out.println(0);
		}
	}
}

import java.util.Scanner;

public class Turn {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();
		a %= 360;
		a += 360;
		a %= 360;

		if (a <= 45 || a >=315) {
			System.out.println(0);
		} else if (a <= 135) {
			System.out.println(1);
		} else if (a < 225) {
			System.out.println(2);
		} else {
			System.out.println(3);
		}
	}
}

import java.util.Scanner;

public class Turn {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();

		if (a > 0) {
			if ((a + 45) % 90 == 0) {
				System.out.println(((a + 45) / 90 - 1) % 4);
			} else {
				System.out.println((a + 45) / 90 % 4);
			}
		} else if (a < 0) {
			if ((a - 45) % 90 == 0) {
				System.out.println((3 * -(a - 45) / 90 - 3) % 4);
			} else {
				System.out.println((3 * -(a - 45) / 90) % 4);
			}
		} else {
			System.out.println(0);
		}
	}
}

import java.util.Scanner;

public class Turn {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();
		a %= 360;
		a += 360;
		a %= 360;

		System.out.println(a);

		if (a <= 45 || a >=315) {
			System.out.println(0);
		} else if (a > 45) {
			System.out.println(1);
		} else if (a > 135) {
			System.out.println(2);
		} else if (a > 225) {
			System.out.println(3);
		}
	}
}

import java.util.Scanner;

public class Turn {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		long a = in.nextLong();

		if (a > 0) {
			if ((a + 45) % 90 == 0) {
				System.out.println((a + 45) / 90 - 1);
			} else {
				System.out.println((a + 45) / 90);
			}
		} else if (a < 0) {
			System.out.println(3 * -(a - 45) / 90);
		} else {
			System.out.println(0);
		}
	}
}

import java.util.Scanner;

public class CF_630M {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long x = scan.nextLong();
		if(x > 0) {
			x = x % 360;
		} else {
			x = -((-x)%360);
		}
		x = -x;
		//System.out.println("=" + x);

		int minDev = 400;
		int ans = 0;
		for(int rot=0;rot<=3;rot++) {
			int dev = (int) Math.min(Math.abs(x-360),Math.abs(x-0));
			//System.out.println(dev + " in " + rot);
			if(dev < minDev) {
				ans = rot;
				minDev = dev;
			}
			x += 90;
			x = x % 360;
		}
		System.out.println(ans);
	}
}

import java.util.*;
public class CodeForces
{

    public static void main(String[] args)
	{

            Scanner in = new Scanner(System.in);
            long angle = in.nextLong();
            if(angle < 0 ) angle = 360 - (Math.abs(angle)%360);
            else angle = angle%360;

            if(angle == 0 || angle == 360) System.out.println(0);
            else if( angle <= 45 ) System.out.println(0);
            else if( angle <= 135) System.out.println(1);
            else if( angle <= 225) System.out.println(2);
            else if( angle <= 315) System.out.println(3);
            else if( angle < 360)  System.out.println(4);
        }

}

import java.util.Scanner;

public class M {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		Long n = in.nextLong();
		n = n%360;
		if(n<0){
			n=360+n;
		}
		System.out.println((int)(n/90.0+.49999999999999));
	}

}

import java.util.Scanner;

public class M {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		Long n = in.nextLong();
		n = n%360;

		if(n<0){
			n=360+n;
		}
		System.out.println(Math.round(n/90.0));
	}

}

import java.io.*;
import java.util.*;
import java.math.*;

public class M {

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

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

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

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

    static InputReader r = new InputReader(System.in);
    static PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {

        ArrayList<int[]> list = new ArrayList<int[]>();

        long k = r.nextLong();
        int x = (int)(k % 360);
        list.add(new int[]{0, Math.min(Math.min(Math.abs(x), Math.abs(x-360)), Math.abs(x+360))});

        for(int i = 1; i <= 3; i++){
            x -= 90;
            x %= 360;
            list.add(new int[]{i, Math.min(Math.min(Math.abs(x), Math.abs(x-360)), Math.abs(x + 360))});
        }

        Collections.sort(list, new Sort());

        for(int[] arr : list){
            System.out.println(Arrays.toString(arr));
        }

        System.out.println(list.get(0)[0]);

        pw.close();
    }

    static class Sort implements Comparator<int[]>{
        public int compare(int[] a, int[] b){
            if(a[1] == b[1]){
                return a[0] - b[0];
            } else{
                return a[1] - b[1];
            }
        }
    }
}

/**
*                _        _                 _
*               | |      | |               | |
*   ___ ___   __| | ___  | |__  _   _    __| | __ _ _ __ _ __ ___ _ __     _   _  __ _  ___
*  / __/ _ \ / _` |/ _ \ | '_ \| | | |  / _` |/ _` | '__| '__/ _ \ '_ \   | | | |/ _` |/ _ \
* | (_| (_) | (_| |  __/ | |_) | |_| | | (_| | (_| | |  | | |  __/ | | |  | |_| | (_| | (_) |
*  \___\___/ \__,_|\___| |_.__/ \__, |  \__,_|\__,_|_|  |_|  \___|_| |_|   \__, |\__,_|\___/
*                                __/ |                               ______ __/ |
*                               |___/                               |______|___/
 */

import java.io.*;
import java.util.*;
import java.math.*;

public class M {

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

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

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

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

    static InputReader r = new InputReader(System.in);
    static PrintWriter pw = new PrintWriter(System.out);

    public static void main(String[] args) {

        ArrayList<int[]> list = new ArrayList<int[]>();

        long k = r.nextLong();
        int x = (int)(k % 360);
        list.add(new int[]{0, Math.min(Math.abs(x), Math.abs(x+360))});

        for(int i = 1; i <= 3; i++){
            x -= 90;
            x %= 360;
            list.add(new int[]{i, Math.min(Math.abs(x), Math.abs(x + 360))});
        }

        Collections.sort(list, new Sort());
        /**
        for(int[] arr : list){
            System.out.println(Arrays.toString(arr));
        }
        */
        System.out.println(list.get(0)[0]);

        pw.close();
    }

    static class Sort implements Comparator<int[]>{
        public int compare(int[] a, int[] b){
            if(a[1] == b[1]){
                return a[0] - b[0];
            } else{
                return a[1] - b[1];
            }
        }
    }
}

/**
*                _        _                 _
*               | |      | |               | |
*   ___ ___   __| | ___  | |__  _   _    __| | __ _ _ __ _ __ ___ _ __     _   _  __ _  ___
*  / __/ _ \ / _` |/ _ \ | '_ \| | | |  / _` |/ _` | '__| '__/ _ \ '_ \   | | | |/ _` |/ _ \
* | (_| (_) | (_| |  __/ | |_) | |_| | | (_| | (_| | |  | | |  __/ | | |  | |_| | (_| | (_) |
*  \___\___/ \__,_|\___| |_.__/ \__, |  \__,_|\__,_|_|  |_|  \___|_| |_|   \__, |\__,_|\___/
*                                __/ |                               ______ __/ |
*                               |___/                               |______|___/
 */

import java.util.ArrayList;
import java.util.Scanner;

public class UpSolve {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner input= new Scanner(System.in);
		long n = input.nextLong();
		n = n + 3600000000000000000l;
		ArrayList<Integer> output =new ArrayList<Integer>();
		int min = 4000;
		for(int b = 0; b < 360; b+= 90){
			output.add(deviation(n+b));
		}
		int count = 0;
		int countId = 0;
		for(Integer d:output){
			if(min > d){
				min = d;
				countId = count;
			}
			count++;
		}
		System.out.println(countId);
	}
	public static int deviation(long n){
		int k = (int)(n%360);
		if(k > 180){
			k = 360 - k;
		}
		return k;
	}
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Main
{
	static long quick(long a, long b)
	{
		long ans=1L;
		while(b!=0)
	    {
	        if((b%2)!=0)
	            ans*=a;
	        b/=2;
	        a*=a;
	    }
	    return ans;
	}
	public static void main(String[] args)
	{
		InputReader in = new InputReader();
//		Scanner in=new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		while(in.hasNext())
		{
			long n=in.nextLong();
			n%=360;
			if(n<-45)n+=360;
			if(n>-315)n-=360;
			out.println((n+44)/90);
		}
		out.close();
	}
}

class InputReader
{
	BufferedReader buf;
	StringTokenizer tok;
	InputReader()
	{
		buf = new BufferedReader(new InputStreamReader(System.in));
	}

	boolean hasNext()
	{
		while (tok == null || !tok.hasMoreElements())
		{
			try
			{
				tok = new StringTokenizer(buf.readLine());
			}
			catch (Exception e)
			{
				return false;
			}
		}
		return true;
	}

	String next()
	{
		if (hasNext())
			return tok.nextToken();
		return null;
	}

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

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

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

	BigInteger nextBigInteger()
	{
		return new BigInteger(next());
	}

	BigDecimal nextBigDecimal()
	{
		return new BigDecimal(next());
	}
}

import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;
import java.io.BufferedWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.IOException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Alex
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskM solver = new TaskM();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskM {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            long input = -1 * in.readLong();
            int start = (int) (input % 360);
            int best = Math.abs(start), bestturns = 0;
            for(int turns = 1; turns < 1000; turns++) {
                start += 90;
                start %= 360;
//            if (turns < 10) {
//                out.printLine(turns, start);
//            }
                int val = Math.min(Math.abs(start), 360 - Math.abs(start));
                if(val < best) {
                    best = val;
                    bestturns = turns;
                }
            }
            out.printLine(bestturns);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if(numChars == -1)
                throw new InputMismatchException();
            if(curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch(IOException e) {
                    throw new InputMismatchException();
                }
                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public long readLong() {
            int c = read();
            while(isSpaceChar(c))
                c = read();
            int sgn = 1;
            if(c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if(c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while(!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if(filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }
}

import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;
import java.io.BufferedWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.IOException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Alex
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskM solver = new TaskM();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskM {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            long input = -1 * in.readLong();
            int start = (int) (input % 360);
            int best = Math.abs(start), bestturns = 0;
            for(int turns = 1; turns < 1000; turns++) {
                start += 90;
                start %= 360;
//            if (turns < 10) {
//                out.printLine(turns, start);
//            }
                int abs = start;
                if(abs < 0) abs += 360;
                int val = Math.min(Math.abs(abs), 360 - Math.abs(abs));
                if(val < best) {
                    best = val;
                    bestturns = turns;
                }
            }
            out.printLine(bestturns);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if(numChars == -1)
                throw new InputMismatchException();
            if(curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch(IOException e) {
                    throw new InputMismatchException();
                }
                if(numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public long readLong() {
            int c = read();
            while(isSpaceChar(c))
                c = read();
            int sgn = 1;
            if(c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if(c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while(!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if(filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(int i) {
            writer.println(i);
        }

    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    public static void main(String[] args) {
//     Test.testing();
        ConsoleIO io = new ConsoleIO();
        new Main(io).solve();
        io.flush();
    }
    ConsoleIO io;
    Main(ConsoleIO io) {
        this.io = io;
    }

    ArrayList<ArrayList<Integer>> gr1;
    boolean[] visit;
    //

    class Pair{
        public Pair(int a, int b){
            this.a = a;
            this.b = b;
        }
        public int a;
        public int b;
    }

    class Edge {
        public Edge(int c, int u,int v) {
            this.u = u;
            this.v = v;
            this.c = c;
        }
        public int u;
        public int v;
        public int c;
    }

    long MOD = 1_000_000_007;
    int n,m,k,fn;
    int[][] map;
    public void solve() {
        int n = (int)(-io.readLong()%360);
        if(n<0)n = 360+n;
        int v = 0;
        if(n>45 && n<135)v=3;
        if(n>=135 && n<=225)v=2;
        if(n>225 && n<315)v=1;
io.writeLine(v+"");
    }

    long gcd(long a, long b) {
        if (a < b) return gcd(b, a);
        if (b == 0) return a;
        return gcd(b, a % b);
    }
}

class ConsoleIO {
    BufferedReader br;
    PrintWriter out;
    public ConsoleIO(){br = new BufferedReader(new InputStreamReader(System.in));out = new PrintWriter(System.out);}
    public void flush(){this.out.close();}
    public void writeLine(String s) {this.out.println(s);}
    public void writeInt(int a) {this.out.print(a);this.out.print(' ');}
    public void writeWord(String s){
        this.out.print(s);
    }
    public String readLine() {try {return br.readLine();}catch (Exception ex){ return "";}}
    public long readLong() {
        return Long.parseLong(this.readLine());
    }
    public int readInt() {
        return Integer.parseInt(this.readLine().trim());
    }
    public long[] readLongArray() {
        String[]n=this.readLine().trim().split(" ");long[]r=new long[n.length];
        for(int i=0;i<n.length;i++)r[i]=Long.parseLong(n[i]);
        return r;
    }
    public int[] readIntArray() {
        String[]n=this.readLine().trim().split("\\s+");int[]r=new int[n.length];
        for(int i=0;i<n.length;i++)r[i]=Integer.parseInt(n[i]);
        return r;
    }
    public void writeIntArray(int[] a) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < a.length; i++) {if (i > 0) sb.append(' ');sb.append(a[i]);}
        this.writeLine(sb.toString());
    }
}

import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	static long x;

	public static void main(String[] args) {
		x = sc.nextLong();

		x = x % 360;

		if (x >= 0 && x <= 45) {System.out.println(0); return;}
		if (x > 45 && x <= 135) {System.out.println(1); return;}
		if (x > 135 && x <= 225) {System.out.println(2); return;}
		if (x > 225 && x < 315) {System.out.println(3); return;}
		if (x >= 315) {System.out.println(0); return;}

		if (x <= 0 && x >= -45) {System.out.println(0); return;}
		if (x < -45 && x > -135) {System.out.println(3); return;}
		if (x <= -135 && x > -225) {System.out.println(2); return;}
		if (x <= -225 && x > - 315) {System.out.println(1); return;}
		if (x <= -315 && x > 0) {System.out.println(0); return;}
	}

}

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 *
 * @author pttrung
 */
public class M_Volbit {

	public static long MOD = 1000000007;

	public static void main(String[] args) throws FileNotFoundException {
		// PrintWriter out = new PrintWriter(new FileOutputStream(new File(
		// "output.txt")));
		PrintWriter out = new PrintWriter(System.out);
		Scanner in = new Scanner();
		long v = in.nextLong();
		v %= 360;

		long min = Math.abs(v);
		int re = 0;
		for (int i = 0; i < 4; i++) {
			v = (v - 90) % 360;
			v = cal(v);
			//System.out.println(v);
			if (Math.abs(v) < min) {
				min = Math.abs(v);
				re = i + 1;
			}
		}
		// System.out.println(min);
		out.println(re);

		out.close();
	}

	public static long cal(long v) {
		if (v < -180) {
			v = 360 + v;
		}
		return v;
	}

	public static int[] KMP(String val) {
		int i = 0;
		int j = -1;
		int[] result = new int[val.length() + 1];
		result[0] = -1;
		while (i < val.length()) {
			while (j >= 0 && val.charAt(j) != val.charAt(i)) {
				j = result[j];
			}
			j++;
			i++;
			result[i] = j;
		}
		return result;

	}

	public static boolean nextPer(int[] data) {
		int i = data.length - 1;
		while (i > 0 && data[i] < data[i - 1]) {
			i--;
		}
		if (i == 0) {
			return false;
		}
		int j = data.length - 1;
		while (data[j] < data[i - 1]) {
			j--;
		}
		int temp = data[i - 1];
		data[i - 1] = data[j];
		data[j] = temp;
		Arrays.sort(data, i, data.length);
		return true;
	}

	public static int digit(long n) {
		int result = 0;
		while (n > 0) {
			n /= 10;
			result++;
		}
		return result;
	}

	public static double dist(long a, long b, long x, long y) {
		double val = (b - a) * (b - a) + (x - y) * (x - y);
		val = Math.sqrt(val);
		double other = x * x + a * a;
		other = Math.sqrt(other);
		return val + other;

	}

	public static class Point implements Comparable<Point> {

		int x, y;

		public Point(int start, int end) {
			this.x = start;
			this.y = end;
		}

		@Override
		public int hashCode() {
			int hash = 5;
			hash = 47 * hash + this.x;
			hash = 47 * hash + this.y;
			return hash;
		}

		@Override
		public boolean equals(Object obj) {
			if (obj == null) {
				return false;
			}
			if (getClass() != obj.getClass()) {
				return false;
			}
			final Point other = (Point) obj;
			if (this.x != other.x) {
				return false;
			}
			if (this.y != other.y) {
				return false;
			}
			return true;
		}

		@Override
		public int compareTo(Point o) {
			return x - o.x;
		}
	}

	public static class FT {

		long[] data;

		FT(int n) {
			data = new long[n];
		}

		public void update(int index, long value) {
			while (index < data.length) {
				data[index] += value;
				index += (index & (-index));
			}
		}

		public long get(int index) {
			long result = 0;
			while (index > 0) {
				result += data[index];
				index -= (index & (-index));
			}
			return result;

		}
	}

	public static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	public static long pow(long a, long b) {
		if (b == 0) {
			return 1;
		}
		if (b == 1) {
			return a;
		}
		long val = pow(a, b / 2);
		if (b % 2 == 0) {
			return val * val % MOD;
		} else {
			return val * (val * a % MOD) % MOD;

		}
	}

	static class Scanner {

		BufferedReader br;
		StringTokenizer st;

		public Scanner() throws FileNotFoundException {
			// System.setOut(new PrintStream(new
			// BufferedOutputStream(System.out), true));
			br = new BufferedReader(new InputStreamReader(System.in));
			// br = new BufferedReader(new InputStreamReader(new
			// FileInputStream(new File("input.txt"))));
		}

		public String next() {

			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					throw new RuntimeException();
				}
			}
			return st.nextToken();
		}

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

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

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

		public String nextLine() {
			st = null;
			try {
				return br.readLine();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}

		public boolean endLine() {
			try {
				String next = br.readLine();
				while (next != null && next.trim().isEmpty()) {
					next = br.readLine();
				}
				if (next == null) {
					return true;
				}
				st = new StringTokenizer(next);
				return st.hasMoreTokens();
			} catch (Exception e) {
				throw new RuntimeException();
			}
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	public static void main(String args[]) {
		InputStream intputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(intputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskM solver = new TaskM();
		solver.solve(in, out);
		out.close();
	}

	static class TaskM {
		public void solve(InputReader in, PrintWriter out) {
			long x = in.nextLong();
			int ans = 0;
			long res = 360;
			long b = x % 360;
			if (b < -180) {
				b = 180;
			}
			if (b > 180) {
				b = b - 360;
			}
			for (int i = 0; i < 4; ++i) {
				if (Math.abs(b) < res) {
					ans = i;
					res = Math.abs(b);
				}
				b -= 90;
				if (b < -180) {
					b = 360 + b;
				}
			}
			out.println(ans);
		}
	}

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

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

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

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

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

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

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				return null;
			}
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	public static void main(String args[]) {
		InputStream intputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(intputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskM solver = new TaskM();
		solver.solve(in, out);
		out.close();
	}

	static class TaskM {
		public void solve(InputReader in, PrintWriter out) {
			long x = in.nextLong();
			int ans = 0;
			long res = 360;
			long b = x % 360;
			if (b < -180) {
				b = 180;
			}
			for (int i = 0; i < 4; ++i) {
				if (Math.abs(b) < res) {
					ans = i;
					res = Math.abs(b);
				}
				b -= 90;
				if (b < -180) {
					b = 360 + b;
				}
			}
			out.println(ans);
		}
	}

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

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

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

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

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

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

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				return null;
			}
		}
	}
}