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". [Image] 

The next figure shows 90 degrees clockwise turn by FPGA hardware. [Image] 


-----Input-----

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


-----Output-----

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


-----Examples-----
Input
60

Output
1

Input
-60

Output
3



-----Note-----

When 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.

Difficulty: interview

Starter code:

Solutions:
n = (-int(input())) % 360

ret, opt = 4, 361
for i in range(4):
    x = (n+90*i)%360
    x = min(x, 360-x)
    if (x, i) < (opt, ret):
        opt, ret = x, i

print(ret)

from functools import reduce
from math import factorial
n = (int(input()) + 45) % 360
print(n // 90 - (n > 0 and n%90 == 0))



n=int(input())%360
if n<=45: print(0)
elif n<=90+45: print(1)
elif n<=180+45: print(2)
elif n<270+45: print(3)
else: print(0)


def sign(x):
    return 1 if x > 0 else -1

def dis(x):
    if x >= 360:
        x %= 360

    if x <= -180:
        return 360 + x
    elif x <= 0:
        return abs(x)
    elif x <= 180:
        return x
    else:
        return 360-x

def __starting_point():

    x = int(input())
    x = (-sign(x))*(abs(x)%360)
    #print(x)

    mindis = dis(x)
    res = 0

    for i in range(1,4):
        newdis = dis(x+90*i)
        if newdis < mindis:
            mindis = newdis
            res = i

    print(res)

__starting_point()

def f(x):
    assert(0 <= x <= 360)
    return min(x, 360 - x)

def main():
    x = int(input())
    a, b, c, d = -x, -x+90, -x+180, -x+270
    a, b, c, d = a%360, b%360, c%360, d%360
    a, b, c, d = f(a), f(b), f(c), f(d)
    L = [(a, 0), (b, 1), (c, 2), (d, 3)]
    L.sort()
    print(L[0][1])

def __starting_point():
    main()
__starting_point()

import sys

n = int(sys.stdin.readline())
n %= 360

_0 = min(360 - n, n)
n = (n - 90) % 360
_1 = min(360 - n, n)
n = (n - 90) % 360
_2 = min(360 - n, n)
n = (n - 90) % 360
_3 = min(360 - n, n)

if (_0 <= min(_1, min(_2, _3))):
    print(0)
    return
if (_1 <= min(_0, min(_2, _3))):
    print(1)
    return
if (_2 <= min(_1, min(_0, _3))):
    print(2)
    return
if (_3 <= min(_1, min(_2, _0))):
    print(3)
    return

x = -int(input()) % 360

l = [x, x+90, x+180, x+270]
l = [min(x%360, (-x)%360) for x in l]
m = min(l)
#print(l)
print(l.index(m))



n = int(input())
n=(n*-1)%360

minVueltas = -1
minValor = -1
for i in range(4):
    temp = (n+90*i)%360
    if temp>180:
        temp = 360-temp
    if minValor==-1 or temp<minValor:
        minVueltas=i
        minValor=temp
print(minVueltas)


n = int(input())
n += 3600000000000000000
n %= 360

if n <= 45:
    print(0)
elif n <= 135:
    print(1)
elif n <= 225:
    print(2)
elif n < 315:
    print(3)
else:
    print(0)

x = int(input())
x = x % 360
if (x <= 45 or x >= 315):
    print(0)
elif (x >= 45 and x <= 135):
    print(1)
elif (x >= 135 and x <= 225):
    print(2)
else:
    print(3)


n = (360 + int(input()) % 360) % 360

ans = 0
bres = n

for i in range(1, 5):
    d = (360 + (n - i * 90) % 360) % 360
    if min(d, 360 - d) < min(bres, 360 - bres):
        bres = d
        ans = i

print(ans)

n = (int(input())+45)%360
if n%90==0 and n!=0:
    print(n//90-1)
else:
    print(n//90)


n = int(input()) % 360
if 45 < n <= 135:
    print(1)
elif 135 < n <= 225:
    print(2)
elif 225 < n < 315:
    print(3)
else:
    print(0)


import math, re, sys, string, operator, functools, fractions, collections
sys.setrecursionlimit(10**7)
dX= [-1, 1, 0, 0,-1, 1,-1, 1]
dY= [ 0, 0,-1, 1, 1,-1,-1, 1]
RI=lambda x=' ': list(map(int,input().split(x)))
RS=lambda x=' ': input().rstrip().split(x)
mod=int(1e9+7)
eps=1e-6
#################################################
x=RI()[0]
x%=360
if x>180:
    x=x-360
ans=0
val=abs(x)
for i in range(1,4):
    x-=90
    if x<-180:
        x=360+x
    if abs(x)<val:
        val=abs(x)
        ans=i
print(ans)





n = int(input())
ans = 0
n %= 360

if n <= 45 or n >= 270:
    ans = 0
if n > 45 and n <= 135:
    ans = 1
if n > 135 and n <= 225:
    ans = 2
if n > 225 and n < 315:
    ans = 3
print(ans)


n=int(input())
n+=3600000000000000000000
x=n%360
if (x<=45):
	print(0)
elif (x<=135):
	print(1)
elif (x<=225):
	print(2)
elif (x<315):
	print(3)
elif (x>=315):
	print(0)

import sys


def chet(a, b):
    ans = (b - a) // 2
    if b % 2 == 0 or a % 2 == 0:
        ans += 1
    return ans


def nechet(a, b):
    ans = (b - a) // 2
    if b % 2 == 1 or a % 2 == 1:
        ans += 1
    return ans


def ans(a, b, c, d):
    return chet(a, c) * chet(b, d) + nechet(a, c) * nechet(b, d)


n = int(input())
ras = n // 360
k = n - 360 * ras
ost = (k + 45) % 90
d = (k + 45) // 90
ans = d if (ost > 0 or d % 4 == 0) else d - 1
print(ans % 4)








x = (int(input()) + 360 * 10 ** 18) % 360

if x <= 45 or x >= 315:
    print(0)
elif x <= 135:
    print(1)
elif x <= 225:
    print(2)
else:
    print(3)

import math

x=int(input())
x %= 360
x = 360-x
curnum=x
for i in range(4):
	if curnum <= 45:
		print(i)
		quit()
	if 360-curnum <= 45:
		print(i)
		quit()
	curnum = (curnum+90) % 360

angle = int(input())
angle = (angle % 360 + 360) % 360
angle = (angle + 44) % 360
answer = (angle % 359) // 90
print(answer)

n = int(input())

t = n - (n // 360) * 360
i = 0
while not (-45 <= t <= 45 or 315 <= t <= 360):
	i += 1
	t -= 90
print(i)


import sys
import math
# sys.stdin = open('input.txt')
# sys.stdout = open('output.txt', 'w')

def main():
    n = int(input())
    n = -n
    n %= 360
    a = n
    a1 = 360 - a
    b = (a + 90) % 360    
    b1 = 360 - b
    c = (b + 90) % 360
    c1 = 360 - c
    d = (c + 90) % 360
    d1 = 360 - d
    ans = min([a, a1, b, b1, c, c1, d, d1])
    if a == ans or a1 == ans:
        print(0)
    elif b == ans or b1 == ans:
        print(1)
    elif c == ans or c1 == ans:
        print(2)
    elif d == ans or d1 == ans:
        print(3)

main()