peterverebics/CodeNet_Python_118 huggingface dataset:
X = int(input())
ans = 0
W = 360
while(True):
    W -= X
    ans += 1
    if W == 0:
        break
    if W < 0:
        W += 360
print(ans)
X = int(input())
n = 360
while(1):
  if n % X == 0:
    print(int(n/X))
    break
  n = n + 360
import math
X = int(input())
# lcm = 360 * X // math.gcd(360, X)
print(360 // math.gcd(360, X))
import math
X = int(input())
gcd = math.gcd(X, 360)
lcm = X * 360 / gcd
print(int(lcm/X))
X = int(input())
cnt = 1
while True:
    if (cnt*X)%360 == 0:
        print(cnt)
        break
    else:
        cnt += 1
X = int(input())
L = 360
def gcd(x, y):
    k, l = x, y
    if y < 0:
        k, l = -k, -l
    while l:
        k, l = l, k % l
    return k
Y = gcd(X, L)
print(L // Y)
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

x=int(input())
for i in range(1,1000):
    if (i*360)%x==0:
        print((i*360)//x)
        exit()
n=int(input())
from math import gcd
print(360//gcd(360,n))
n=int(input())
if(360%n==0):
  print(360//n)
else:
  i=1;
  while (n*i)%360!=0:
    i+=1
  print(i)
import sys

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


for line in sys.stdin:
    line = line.strip()
    if line == "":
        break

    X = int(line)
    ans = 360 // gcd(X, 360)
    print(ans)
from sys import stdin
rs = lambda : stdin.readline().strip()
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))

def gcd(a, b):
    if a % b == 0:
        return b
    else:
        return gcd(b, a % b)

def main():
    X = ri()
    K = 360 // gcd(360, X)
    print(K)


if __name__ == '__main__':
    main()
x = int(input())
i = 1
while True:
    a = (360*i) / x
    if a == int(a):
        break
    i += 1
print(int(a))
x=int(input())
ans=0
i=1
while (x*i)%360!=0:
  i+=1
print(i)
x = int(input())
for i in range(1,361):
    if x*i%360 == 0:
        print(i)
        break
x=int(input())
for m in range(1,180):
    if 360*m%x==0:
        print(360*m//x)
        exit(0)
def GCD(a: int, b: int) -> int:
    return a if b == 0 else GCD(b, a % b)


def LCM(a: int, b: int) -> int:
    return a * b // GCD(a, b)


x = int(input())
ans = LCM(x, 360) // x
print(ans)
import math

x=int(input())

print(360//math.gcd(360,x))
if __name__ == "__main__":
    X = int(input().strip())
    i = 1
    while True:
        if 360*i%X == 0:
            break
        else:
            i +=  1
    print(int(360*i/X))
import sys
input = sys.stdin.readline

def linput(tt=int):
	return list(map(tt,input().split()))

def gcd(a: int, b: int):
	while b: a, b = b, a%b
	return a

def lcm(a: int, b: int):
	return a * b // gcd(a, b)

def main():
	#a,b,c = linput()
	X = int(input())
	
	res = 0
	R = 360
	
	T = 360
	G = 0
	while T!=G:
		if T>G: G+=X; res+=1
		else: T+=R
	
	print(res)

if __name__ == "__main__":
	main()
import math
x=int(input())
print(360//math.gcd(x,360))
import math
print(int(360 / math.gcd(int(input()), 360)))
def solve(X):
    cnt = 1
    while True:
        if (X * cnt) % 360 == 0:
            return cnt
        else:
            cnt += 1

def main():
    X = int(input())
    print(solve(X))

if __name__ == "__main__":
    main()
X = int(input())

ans = 360
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)

ans = 360 // gcd(X, 360)
print(ans)
x = int(input())
i = 1
while (360 * i) % x != 0:
  i += 1
ans = (360 * i) // x
print(ans)
def factor(n):
  l=[]
  while n%2==0:
    n=n//2
    l.append(2)
  for i in range(3,int(n**0.5)+1,2):
    while n%i==0:
      n=n//i
      l.append(i)
  if n>2:
    l.append(n)
  return l

n=int(input())
if 360%n==0:
  print(360//n)
else:
  ll=factor(n)
  mul=1
  #print(ll)
  use=360
  for i in range(len(ll)):
    if use%ll[i]==0:
      use=use//ll[i]
    else:
      mul*=ll[i]
  print((360*mul)//n)
M = int(input())
i = 1
while True:
  if(M*i%360==0):
    print(int(i))
    exit()
  else:
    i+=1
import math
x=int(input())
num=360*x/math.gcd(360,x)
print(int(num//x))
from math import *


def f(deg):
  di = radians(90)
  turn = radians(deg)
  i = 1
  x = 0
  y = 1
  while not done(x, y):
    di += turn
    i += 1
    y += sin(di)
    x += cos(di)
    # print(x, y, i, di)
  return i


def done(x, y):
  return abs(x - 0) < 0.00001 and abs(y - 0) < 0.00001

print(f(int(input())))
x=int(input())
i=1

while (x*i)%360!=0:
  i=i+1

print(i)
import math


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


x = int(input())
print(lcm(360, x) // x)
from math import gcd
def lcm(x,y):
    return (x*y)//gcd(x,y)
X = int(input())
num = lcm(360,X)
print(int(num/X))
from math import gcd
X = int(input())
Y = X*360//gcd(X, 360)
print(Y//X)
# for i in range(m):
# for i in range(int(input())):
#n,k= map(int, input().split())
#for _ in range(int(input())):
    #n,k= map(int, input().split())
#from collections import Counter
n=int(input())
if n%360==0:
    print(0)
    exit()
else:
    var=1
    while (var*n)%360!=0:
        var+=1
    print(var)
# -*- coding: utf-8 -*-
import math
 
def Strider():
 
    NumA = int(input())
 
    count = 360/NumA
    
    NumB = 1
    
    while ((360*NumB % NumA) != 0):
        NumB = NumB + 1
        count = 360*NumB/NumA
    
    print(int(count))
 
if __name__ == '__main__':
    Strider()
x = int(input())

if 360 % x == 0:
    print(360//x)
else:
    mod = 360 % x
    n = 360 // x
    print(n * (360 // mod))
n = int(input())



from math import cos,sin,pi

x,y=[0,0]
rad = 0
for i in range(10000):
    x += cos(pi*rad*n/180)
    y += sin(pi*rad*n/180)
    rad+=1
    if abs(x) < 0.00001 and abs(y) < 0.00001:
        print(i+1)
        exit()
def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

def lcm(a, b):
    return a*b//gcd(a, b)

X = int(input())
print(lcm(360, X)//X)
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
b=int(input())
print(lcm(360, b)//b)
X=int(input())
i=1
while True:
    x=X*i
    if x%360==0:
        print(i)
        exit()
    else:
        i+=1
x = int(input())
r = 360
count = 0
while r != 0:
  r = r - x
  if r < 0:
    r += 360
  count += 1
print(count)
from math import gcd
def lcm(a,b):
    return a*b//gcd(a,b)
X=int(input())
from math import ceil
print(lcm(360,X)//X)
x=int(input())
c=0
n=0
if 360%x ==0:
    print(int(360/x))
else:
    while not(n==0 and c>0):
        n=(n+x%360)%360
        c+=1
    print(c)
X = int(input())

for k in range(3, 361):
    if (k*X)%360==0:
        print(k)
        exit()
def lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
x = int(input())
if 360%x == 0:
    print(int(360/x))
else :
    print(int(lcm(360,x)/x))
X = int(input())
 
for k in range(1, 361):
  if (k * X) % 360 == 0:
    print(k)
    break
X = int(input())

k = 1
while True:
    if (X*k) % 360 == 0:
        print(k)
        break
    k += 1
X = int(input())

for n in range(1,361):
    if 360*n%X==0:
        print(int(360*n/X))
        exit()
import math
x=int(input())
i=1
while((x*i)%360!=0):
  i+=1
print(i)
from math import gcd
x = int(input())
print((x * 360  // gcd(x, 360)) // x)
from math import gcd
n = int(input())
print(360*n//gcd(n,360)//n)
import math
n = int(input())
print(360 // math.gcd(360, n))
from math import gcd

X = int(input())
print(360 // gcd(X, 360))
X = int(input())
c = 1
while True:
    if (360*c)%X == 0:
        a = (360*c)//X
        break
    else:
        c += 1

print(a)
x = int(input())
for i in range(1, 361):
    if i*x%360==0:
        print(i)
        break
X = int(input())


def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd(a, b)


print(lcm(X, 360) // X)
X = int(input())
n = 2
k = 0

k = 360//X
while(360*(n-1) % X != 0):
    k = (360*n)//X
    n += 1

print(k)
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
x = int(input())
t = lcm(x, 360)
print(t // x)
from math import gcd
x = int(input())

print(360 // gcd(360, x))
import sys
x = int(input())
y = 0
m = 1
if 360 % x == 0:
    m = int(360 / x)
else:
    for i in range(1, 1000):
        y = x * i
        if y > 360:
            if y % 360 == 0:
                m = i
                break
                
print(m)
import math

n = int(input())

cnt = 0
x = 0
y = 0
r = 0

while True:
    cnt += 1
    x += round(math.cos(math.radians(r)), 6)
    y += round(math.sin(math.radians(r)), 6)
    r += n
    
    if x <= 0.00000001 and y <= 0.00000001:
        break

print(cnt)
x = int(input())
b = x
t = 1

while b % 360 != 0:
    b += x
    t += 1

print(t)
from math import gcd
X = int(input())

print(360//gcd(X,360))
x = int(input())
d = 360
while True:
    if d%x == 0:
        print(d//x)
        exit()
    d += 360
import math
import sys
from collections import Counter
import bisect
readline = sys.stdin.readline


def main():
    cnt = 0
    arg = 0
    x = int(readline().rstrip())
    for i in range(1000):
        cnt += 1
        arg += x
        arg %= 360
        if arg == 0:
            break
    print(cnt)


if __name__ == '__main__':
    main()
N = int(input())
k = 1
while True:
  if k*N%360==0:
    print(k)
    exit()
  else:
    k+=1
X= int(input())
max_test = 100000
for i in range(1,max_test):
  if i * X % 360 == 0:
    break

print(i)
k = int(input())
ct = 1
goal = k
while k:
  ct += 1
  k = (k + goal) % 360
print(ct)
X = int(input())

x = 360
while True:
    if x % X == 0:
        print (x // X)
        break
    x += 360
from math import gcd
x=int(input())
print(360//gcd(x,360))
import math
x=int(input())
ct=0
for i in range(1000):
  ct+=x
  if ct%360==0:
    print(i+1)
    exit()
n=int(input())
from math import gcd
m=gcd(360,n)
print(360//m)
import math
X = int(input())
g = math.gcd(360, X)
print(360//g)
x = int(input())
ans = 0
cnt = 0
while True:
  ans += x
  cnt += 1
  if ans%360 == 0:
    print(cnt)
    break
X = int(input())
m  = 1
while(360*m%X!=0):
    m+=1
print(360*m//X)
from fractions import gcd
X = int(input())
print(int(360/gcd(X, 360)))
import math

a = int(input())

print(int(360*a/math.gcd(360,a)/a))
def gcd(x,y):
  while y!=0:
    x,y=y,x%y
  return x
print(360//gcd(360,int(input())))
import math
n=int(input())
print(360//math.gcd(n,360))
from fractions import gcd

def main():
    x = int(input())
    a = gcd(360,x)
    print(360//a)

if __name__ == "__main__":
    main()
import math
X = int(input())
print(360 // math.gcd(360, X))
cnt=0
radi=0
x=int(input())
while True:
  cnt+=1
  radi+=x
  radi%=360
  if radi==0:
    print(cnt)
    break
x = int(input())

k = 1
angle = x

while True:
    if angle >= 360 and angle % 360 == 0:
        break
    angle += x
    k += 1

print(k)
X = int(input())
i = 1
while (i*X) % 360 != 0:
    i += 1
print(i)
x= int(input())
btdt=[]
theta=x+90
count=0
while(theta not in btdt):
    btdt.append(theta)
    theta=(theta+x)%360
    count+=1
print(count)
x = int(input())
"""
xをd倍すると360の倍数になる
"""
cnt = 0
ans = 0
while True:
	cnt += x
	ans += 1
	if cnt % 360 == 0:
		break
print(ans)
from math import gcd
a=int(input())
print(360*a//gcd(360,a)//a)
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


x = int(input())
y = gcd(360, x)
y = (360*x)//y
print(y // x)
X=int(input())
import math
a=360*X//math.gcd(360,X)
print(a//X)
import math
X = int(input())

i = 1
while True:
    net = (i * X)/360
    if math.floor(net) == math.ceil(net):
        break
    else:
        i+=1
print(i)
x = int(input())
#import fractions
import math
from functools import reduce
def lcm_base(x, y):
  #return (x * y) // fractions.gcd(x, y)
  return (x * y) // math.gcd(x, y)

l = lcm_base(x, 360)
print(l//x)
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    X = int(input())
    ans = INF
    for i in range(1,300):
        if 360*i%X == 0:
            ans = min(ans,360*i//X)
    print(ans)
if __name__ == '__main__':
    main()
import sys
input = sys.stdin.readline
from math import gcd

X=int(input())
LCM=X*360//gcd(360,X)
print(LCM//X)
X = int(input())
for i in range(1,10**7):
    if (i*X)%360 == 0:
        print(i)
        exit()
from math import gcd

X=int(input())
g=gcd(X,360)
print((360)//(g))
X = int(input())
cnt = 1
while True:
    tmp = X * cnt
    m, d = divmod(tmp, 360)
    if m >= 1 and d == 0:
        print(cnt)
        exit()
    cnt += 1
x = int(input())
if 360 % x == 0:
    print(360//x)
else:
    for i in range(1, 10000):
        if x*i % 360 == 0:
            print(i)
            exit()
X = int( input() )
K = 1
angle = X
while angle%360>0:
  angle += X
  K += 1
print(K)
a = int(input())
x = a
while x%360:
 x += a
print(x//a)
N = int(input())
all = 360
while all%N != 0:
    all += 360
print(all//N)
x = int(input())
total = 0
ans = 0

i = 0
while i == 0:
    total = total + x
    ans = ans + 1
    if total % 360 == 0:
        print(ans)
        break
x = int(input())
for i in range(1,10000):
    if (i*x) % 360 == 0:
        print(i)
        break
def gcd(m,n):
	if n==0:
		return m
	return gcd(n,m%n)
def lcm(a,b):
	return a*b//gcd(a,b)
x=int(input())
l=lcm(360,x)//x
print(l)
X=int(input())
ans=1
while X*ans%360>0:
    ans+=1
print(ans)
from math import gcd
x = int(input())
# kx が 360 度になるような最小の k が答え
k = x * 360 // gcd(x, 360)
print(k // x)
x=int(input())
y=x;
k=1;
while(x%360):
  x+=y;k+=1;
print(k)
def gcd(a,b):
  if b == 0:return a
  return gcd(b,a%b)
 
a = int(input())
print(360//gcd(360,a))
X = int(input())
for n in range(1, 361):
    if 360 * n % X == 0:
        print(360 * n // X)
        exit()
#!/usr/bin python3
# -*- coding: utf-8 -*-

from math import gcd        #for python3.8

def lcm(a,b):
    G = gcd(a, b) #最大公約数
    L = (a//G)*b #最小公倍数
    return L

def main():
    X = int(input())
    print(lcm(X,360)//X)

if __name__ == '__main__':
    main()
import math

x = int(input())

z = (x * 360) // math.gcd(x, 360)

print(z//x)
x = int(input())
for i in range(1, 361):
    if x * i % 360 == 0:
        print(i)
        exit()
import math
x=int(input())
if 360%x==0:
    print(360//x)
else:
    LCM=(360*x)//math.gcd(360,x)
    print(LCM//x)
x = int(input())
for i in range(360):
    if x*(i+1)%360 == 0:
        print(i+1)
        break
def solve(x):
    s = 0
    for i in range(360):
        s += x
        if s % 360 == 0:
            return i + 1
    return 0


def main():
    x = int(input())
    res = solve(x)
    print(res)


def test():
    assert solve(90) == 4
    assert solve(1) == 360


if __name__ == "__main__":
    test()
    main()
x = int(input())

ans = 0
tmp = 0
while True:
    ans += 1
    tmp += x
    if tmp % 360 == 0:
        break
print(ans)
x=int(input())
from math import gcd
x=gcd(x,360)
print(360//x)
x=int(input())
def gcd(a,b):
  while b:a,b=b,a%b
  return a
g=gcd(x,360)
print(360//g)
X = int(input())
cnt = X
en = 360
ans = 0
while True:
    if en%cnt==0:
        ans = en//X
        break
    if en < cnt:
        en+=360
    cnt += X
print(ans)
#  =========     /\       /|    |====/|
#      |        /  \       |    |   / |
#      |       /____\      |    |  /  |
#      |      /      \     |    | /   |
#  ========= /        \  =====  |/====|  
#  code

def main():
    x = int(input())
    k = 1
    while ( x * k ) % 360:
        k += 1
    print(k)
    return

if __name__ == "__main__":
    main()
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

x = int(input())
for i in range(1, 1000):
    if i * x % 360 == 0:
        print(i)
        exit()
import math
import time

X = int(input())
K = 0
a = X
E = 0.1 ** 5

now = [0.0, 0.0]
while True:
    if now[0] <= E and now[0] >= -E and now[1] >= -E and now[1] <= E and K:
        print(K)
        break

    now[0] += math.cos(math.radians(a))
    now[1] += math.sin(math.radians(a)) 

    a += X
    K += 1
import sys

X = int(input())

n = 1
while True:
    if 360 * n % X == 0:
        print(360 * n // X)
        break
    n += 1
x=int(input())
for i in range(1,361):
    if not (x*i)%360:
        print(i)
        break
import math

X = float(input())

p = 0+0j
d = 1+0j
ans = 0
while True:
  d *= math.cos(X/180.*math.pi)+math.sin(X/180.*math.pi)*1j
  p += d
  ans += 1
  if abs(p)<0.0001:
    break
print(ans)
X=int(input())

ans=1
temp=X
while temp%360!=0:
    temp+=X
    ans+=1

print(ans)
x = int(input())

print([k for k in range(1, 361) if x*k % 360 == 0][0])
n = int(input())
if 360%n:
    print(360//(360%n)*(360//n))
else:
    print(360//n)
import math

def lcm(a, b):
    return int(a * b / math.gcd(a, b))

X = int(input())
print(int(lcm(X, 360) / X))
import math
n = int(input())
print(360 // math.gcd(n, 360))
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n = int(readline())
i = 0
ans = 0
while True:
    i += n
    i %= 360
    ans += 1
    if i == 0:
        break
print(ans)
def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x
X = int(input())
a = gcd(X,360)
Y = (X//a)*360
print(Y//X)
import sys
import math

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

X = int(input())
g = math.gcd(360, X)

print(360 // g)
from math import gcd
from sys import stdin
N = int(stdin.readline().rstrip())
print(360//gcd(N, 360))
x=int(input())
if(360%x==0):
    print(int(360/x))
elif(360%(180-x)==0):
    print(int(360/(180-x)))
else:
    m=2
    while(1):
        if((360*m)%x==0):
            print(int(360*m/x))
            break
        elif((360*m)%(180-x)==0):
            print(int(360*m/(180-x)))
            break
        m+=1
import math
x = int(input())

for i in range(1, 10000):
    if x * i % 360 == 0:
        print(i)
        exit()
cnt=1
x=int(input())
while True:
    if cnt*360 % x ==0:print(cnt*360//x);exit()
    cnt+=1
x = int(input())
i = 1
val = x
while val % 360 != 0:
  val += x
  i += 1
print(i)
if __name__ == "__main__":
    x = int(input())

    count = 0
    theta = 0
    while True:
        count += 1
        theta += x
        if theta%360 == 0:
            break

    print(count)
n=int(input())
x=n
c=1
while(x%360):
    x+=n
    x%=360
    c+=1
print(c)
from math import gcd
X = int(input())

def lcm(n, m):
    return n * m // gcd(n, m)

print(lcm(X, 360) // X)
x = int(input())
for i in range(1,64440):
    if (x*i) % 360 == 0:
        print(i)
        exit()
x = int(input())

for k in range(1, 361):
    if x * k % 360 == 0:
        print(k)
        exit()
X = int(input())
import math
print(360 // math.gcd(X, 360))
import numpy
x=int(input());print(numpy.lcm(360,x)//x)
import math
x=int(input())
print(x*360//(math.gcd(x,360))//x)
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

def solve():
    x = ni()
    print(360 // gcd(360, x))
    return

solve()
import math
x = int(input())
print(360 // math.gcd(360, x))
import math
a=int(input())
i=1
while True:
    if 360*i%a==0:
        print(int(360*i/a))
        break
    else:
        i+=1
a = int(input())
ans = a + a**2 + a**3
print(ans)
X = int(input())
if 360%X == 0:
	print(360//X)
else:
	print(180)
def default():
    t=int(input())
    print(min(360//t,306//(180-t)))
if(__name__=="__main__"):
    default()
import math
x = int(input())
print(math.floor(float(360)/float(x)))
import math

X = int(input())

if (360 % X == 0):
    print(int(360 / X))
else:
    print((360 * X) // math.gcd(360, X))
t=int(input())
if(360%t==0):
  print(int(360/t))
else:
  t=360/t
  s=360%t
  print(t*s)
x = int(input())
if 360%x==0:
  print(360//x)
else:
  print(360)
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    X = int(input())

    x1, x2 = X, 180 - X
    for n in range(3, 361):
        s = 180 * (n - 2)
        d, m = divmod(s, n)
        if d == x1 or d == x2:
            print(n)
            break


main()
x=int(input())
import math
K=360/math.gcd(x,360)
print(K)
degree = float(input())
max_num = 360

if(1 <= degree <= 179 and degree.is_integer() == True):
    answer = round(max_num / degree)
    print(answer)
elif(degree.is_integer() == False):
    print(False)
else:
    print(False)
b3=[39, 78, 156, 161, 175, 168]
a=int(input())
b=360/a
b2=str(b)
head, sep, tail = b2.partition('.')
for c in b3:
    if c==a:
        print(int(head))
if tail=='0':
    print(int(b))
else:
    print(int(head)+1)
X = input()
X_int = int(X)

if 360%X_int==0:
  print( int( 360 / X_int) )
else:
  print( 360 )
X = int(input())
for i in range(1, 361):
  if i%X == 0:
    print(i//X)
    exit()
N = int(input())
a=360/N
print(int(a))
b=isinstance(a, float)
text_a = str(b)
text_b =float
c=text_a == text_b
if c!=False:
    print(int(a+1))
import sys
readline = sys.stdin.readline

def gcd(a,b):
    if a < b:
        a,b = b,a
    while a % b != 0:
        r = a % b
        a,b = b,r
    return b

def solve():
    X = int(readline())
    a = 180 - X

    g = gcd(a, 360)
    ans = 360 // g
    print(ans)


solve()
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys
input = sys.stdin.readline
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]

x = inp()
ans = 360/x
import math
print(int(math.ceil(ans)))
x=int(input())
if(360%x==0):
  print(360//x)
x = int(input())
print((360 -1)  // x + 1)
import math

delta=180-int(input())
theta=0
btdt=[]
count=0
while(theta not in btdt):
    btdt.append(theta)
    theta=(theta+delta)%360
    count+=1
print(count)
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    print(360//int(input()))

if __name__ == '__main__':
    main()
X = int(input())
print(X if 360 % X else 360 // X)
x=int(input())
if(360%x==0):
  print(360/x)
from math import gcd
def resolver(X):
    if 360 % X == 0:
        return 360 // X
    ans = 360 * X // gcd(360, X) 
    return ans



def main():
    X = int(input())
    ans = resolver(X)
    print(ans)


if __name__ == '__main__':
    main()
a=int(input())
x = 0
i = 1
while(1):
  x += a
  i += 1
  x %= 360
  if x:
    continue
  else:
    print(i)
    quit()
X = int(input())

if X > 90:
    X = 180 - X

total = 1
while ((X * total) % 360 != 0):
    total += 1

print(total)
def times(X):
    if 1< X < 179:
        K = 360/X
        print(K)
        return K
    else:
        print("please input an integer.")

times(90)
times(1)
k = list(map(int,input().split()))
print(int(360/k[0]))
import math
n = int(input())
print(int(math.ceil(360/n)))
t=int(input())
if(360%t==0):
  print(int(360/t))
else:
  t=360/t
  s=360%t
  print(int(t)*s)
def times(X):
    if X == int(X):
        if 1<= X <= 179:
            K = 360/X
            if int(K) < K :
                K = int(K) + 1
                print(K)
            else:
                print(int(K))
        else:
            print("please input another number")
    else:
        print("please input an intege")
n=int(input())
for i in range(1, n):
  x=360*i%n
  if x==0:
    print(360*i//n)
    break;
  else:
    continue;
X = int(input())
K = 360//X
if K*X < 360:
  K = K+1
print(K)
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
 
X=int(input())

# X x ans = 360
# ans = 360/X

if X*360//math.gcd(X,360) == 360:
    print(360//X)
else:
    print(X*360)
import math

k = 1
x = float(input())
while  x*k%360 == 0:
  k += 1	
print(k)
X = int(input())

if 360 % X == 0:
    ans = 360 // X
else:
    if X > 90:
        ans = 360 // (180 - X)
    else:
        ans = 360
print(ans)