peterverebics/CodeNet_Python_118 huggingface dataset:
import argparse
import collections
import logging.config
import sys
import csv
import numpy as np

def tstr(n):
  total = n
  cnt = 1
  while total%360 != 0:
#    print (str(cnt) + "," + str(total))
    cnt += 1
    total += n 
  return (cnt)


def main():
  N = int(input())
  print (tstr(N))

if __name__ == '__main__':
    main()
X = int(input())
i = 1
while True:
    if X * i % 360 == 0:
        break
    else:
        i += 1
print(i)
x = int(input())

kaiten=360
while kaiten%x!=0:
  kaiten+=360
  
print(kaiten//x)
x=int(input())
for i in range(1,x+1):
  if (360*i)%x==0:
     print((360*i)//x)
     break
import sys
x=int(input())

for j in range(1,361):
    for k in range(1,361):
        if 360*k==x*j:
            print(j)
            sys.exit()
a=int(input())
x = 0
i = 0
while(1):
  x += a
  i += 1
  x %= 360
  if x:
    continue
  else:
    print(i)
    quit()
import math
x = int(input())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
if x == 1:
  print(int(360 / x))
elif x == 45:
  print(int(360 / x))
elif x == 90:
  print(int(360 / x))
else:
  z = lcm(x, 360)
  print(int(z / x))
import math

x = int(input())
y = (x*360)//math.gcd(x,360)//x
print(y)
def main():
    X = int(input())
    ans = 0
    x = 360
    while x != 0:
        x = x - X
        ans += 1
        if (x < 0):
            x += 360
    print(ans)


if __name__ == '__main__':
    main()
x = int(input())
xSum = 0
cnt = 1

while True:
  xSum += x
  if xSum%360 == 0:
    break
  cnt += 1
print(cnt)
# coding: utf-8


def solve(*args: str) -> str:
    x = int(args[0])
    k = 1
    y = x
    while y % 360 != 0:
        y = y+x
        k += 1
    return str(k)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
X = int(input())
i = 1
flag = 0
while flag == 0:
    if (360*i) % X ==0:
        flag = 1
    else:
        i += 1

print((360*i)//X)
X=int(input())
for i in range(1,10**10):
    K=360*i//X
    if K*X==360*i:
        print(K)
        exit()
r=int(input())
d=360
while d%r!=0:
    d+=360
print(d//r)
x=int(input())
for i in range(1,1000):
	if 360*i%x==0:
		ans=360*i//x
		break
print(ans)
X = int(input())

k = 1
while True:
    if (X * k) % 360 == 0:
        print(k)
        exit()
    k += 1
X = int(input())
flag = 0
K = 0
n = 1
ans = 0


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


while flag == 0:
    K = (360 * n) / X
    if is_integer_num(K):
        flag = 1
        ans = K
    else:
        n = n + 1

print(int(ans))
import math
X = int(input())

print ((X*360//math.gcd(X,360)) // X)
import math
X = int(input())
Y = X
x = 1
y = 0
K = 1
while x != 0 or y != 0:
    x = round(x + math.cos(math.radians(X)),6)
    y = round(y + math.sin(math.radians(X)),6)
    X = X + Y 
    K += 1
print(K)
from math import gcd
x = int(input())
print((360//gcd(360, x)))
x = int(input())
k = 0
while True:
  k += 1
  if (x * k)%360 == 0:
    print(k)
    break
import math
M = 360
X = list(map(int, input().split()))[0]
Y = math.gcd(M, X)

result = M // Y
print(result)
X=int(input())
from math import gcd

ans=360//gcd(X, 360)
print(ans)
y=x=int(input())
while y%360:y+=x
print(y//x)
X=int(input())
ans=1
while True:
  if ans*X%360==0:
    print(ans)
    break
  ans+=1
import math

x = int(input())
print(360 // math.gcd(360, x))
x = int(input())

n=1

while 1:
    angle_n = 360*n
    if angle_n % x == 0:
        ans = angle_n // x
        break
    else:
        n += 1

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

x = int(input())
y = x * 360 // gcd(x, 360)
print(y//x)
x = int(input())


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


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


print(lcm(360, x)//x)
x = int(input())
for i in range(1, 360+1):
    if (x*i)%360 == 0:
        print(i)
        exit()
mod = 1000000007
eps = 10**-9


def main():
    import sys
    from math import gcd
    input = sys.stdin.readline

    x = int(input())
    print(360 // gcd(360, x))
    

if __name__ == '__main__':
    main()
import math
X=int(input())
L=(X*360)//math.gcd(X,360)
K=L//X
print(K)
n = int(input())
res = 1
while True:
    if (res * n) % 360 == 0:
        break
    res += 1
print(res)
import math
degree =int(input())
degree = math.radians(degree)
count = [1]
x, y = 0, 0
for i in count:
    xi, yi = math.cos(i * degree), math.sin(i * degree)
    x += xi
    y += yi
    if -0.000001 <= x<= 0.000001 and -0.000001 <= y<= 0.000001:
        print(i)
    else:
        count.append(i+1)
X = int(input())

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

for i in range(1,10**5):
    if (x*i) % 360==0:
        print(i)
        exit()
def gcd(m, n):
    if n > m:
        return gcd(n, m)
    elif n == 0:
        return m
    return gcd(n, m % n)

X = int(input())
print(360 * X // gcd(360, X) // X)
import math as m
x = int(input())
print(int(360/m.gcd(360,x)))
import sys
def input():return sys.stdin.readline()[:-1]
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
from math import gcd 
x=N()
print(x*360//gcd(x,360)//x)
def gcd(a,b):
    if b==0: return a
    return gcd(b,a%b)

x=int(input())
print(360//gcd(360,x))
from math import gcd
x=int(input())
z=(x*360)//gcd(x,360)
print(z//x)
x=int(input())
k=1
while k*x%360:k+=1
print(k)
import math
 
k = 1
x = float(input())
while  x*k%360 != 0:
  k += 1	
print(k)
import math
n=int(input())
if 360%n==0:
    print(360//n)
else:
    r=360*n//math.gcd(360,n)
    r//=n
    print(r)
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

MOD = 10 ** 4 + 7

N = int(input())
k = 1
while True:
    if N * k % 360 == 0:
        print(k)
        break
    k += 1
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

i = ni()

for j in range(1,360):
    if (360*j)%(360-i) == 0:
        n = (360*j)//(360-i)
        print(n)
        break
x = int(input())
for i in range(1,361):
  if x*i%360 == 0:
    print(i)
    exit()
from math import gcd

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

x = int(input())
ans = int(lcm(360, x) // x)
print(ans)
import math
x = int(input())
lcm =(x * 360) / math.gcd(x, 360)

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

x = int(input())
y = 360

lcm = x * y // math.gcd(x, y)
print(lcm//x)
n=int(input())
t=360
while t%n!=0:
    t=t+360
print(t//n)
x=int(input())

cnt=1

kaku=x

for i in range(1000):
    if kaku%360!=0:
        kaku=kaku+x
        cnt=cnt+1
print(cnt)
import math

n=int(input())
a=int(n*360/math.gcd(n,360))
if n==360:
    print(1)
else:
    print(int(a/n))
x=int(input())
for i in range(1,360):
    if 360*i/x%1==0:
        break
print(int(360*i//x))
X = int(input())
i = 1

while (360*i) % X != 0:
  i += 1
ans = 360*i//X
print(ans)
def main():
    x = int(input())
    if False:
        print((360 // x) if 360%x == 0 else (360 // x)+1)
    else:
        k = 1
        temp = x
        while temp % 360 != 0:
            k += 1
            temp += x
        print(k)


    temp = 360 // x

if __name__ == '__main__':
    main()
x = int(input())
i = 1
while(1):
    if (x*i)%360 == 0:
        break 
    i += 1
print(i)
from math import gcd

X=int(input())
print(X*360//gcd(360,X)//X)
# -*- coding: utf-8 -*-


def main():
    import sys
    input = sys.stdin.readline

    x = int(input())

    for i in range(1, 10 ** 6):
        if (i * x) % 360 == 0:
            print(i)
            exit()


if __name__ == '__main__':
    main()
import math
def main():
    N = int(input())
    K = 0
    X = 0
    Y = 0
    R = 90

    while True:
        R = (N+R)%360
        K+=1
        X += math.cos(math.radians(R))
        Y += math.sin(math.radians(R))
        if abs(X)<0.0005 and abs(Y)<0.0005:
            print(K)
            break

if __name__ == '__main__':
    main()
x = int(input())
from math import gcd
g = gcd(x,360)
print(360//g)
#!/usr/bin/env python3
import math

def main():
    x = int(input())
    print(((360 * x) // math.gcd(360,x)) // x)


if __name__ == '__main__':
    main()
X = int(input())
ROTATION = 360

K = 1
while K * X % 360 != 0:
    K += 1

print(K)
import math

ang = int(input())
rad = ang/360*(2*math.pi)

k = 1
x = 1.0
y = 0.0
current = 0
while round(x,3) != 0.0 or round(y,3) != 0.0:

    current += rad
    x += math.cos(current)
    y += math.sin(current)

    k+=1

print(k)
import math
x=int(input())
x=180-x

ans=360//math.gcd(360,x)

ex=[60,120]

if(x in ex):
    x=180-x
    ans=360//math.gcd(360,x)
print(ans)
#for i in range(1,180):
#    if(360//math.gcd(360,i)==6):
#        print(i,360//math.gcd(360,i))
#    if(i==x):
        #print("問題の箇所",x,ans)
import math
X = int(input())
x = 1
y = 0
p = math.pi
count = 1
while abs(x) > 1/100000000 or abs(y) > 1/100000000:
    x += math.cos(count*X*p/180)
    y += math.sin(count*X*p/180)
    count += 1
print(count)
x = int(input())
for y in range(1, 361):
    if 360 * y % x == 0:
        print(360 * y // x)
        exit()
x = int(input())

for i in range(1, 10000):
    if (x * i % 360 == 0):
        print(i)
        exit()
x = int(input())
a = 360
for _ in range(360):
    if a%x == 0:
        print(a//x)
        break
    else:
        a += 360
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
 
 
 
num1 = int(input())
a=lcm(num1,360)
b=a/num1
print(int(b))
import sys
x = int(input())
ans = 2
while(True):
    if x*ans % 360 == 0:
        print(ans)
        sys.exit()
    ans +=1
X=int(input())

for i in range(1,10**9):
  if (i*X)%360==0:
    print(i)
    break
import math
from fractions import Fraction

x = int(input())


k = 0
while True:
    k += 1
    s = x * k
    if s % 360 == 0:
        break
print(k)
import sys
readline=sys.stdin.readline

X=int(readline())

K = 0
rad = 0
while True:
  rad += X
  K += 1
  if rad % 360 == 0:
    print(K)
    break
def  gcd(a,b):
  while b:
    a,b = b,a%b
  return a

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

n = int(input())

if 360%n == 0:
    print(360//n)
else:
    print(lcm(n,360)//n)
x = int(input())

k = 1
while True:
    if x*k % 360 == 0:
        print(k)
        exit()
    k += 1
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


def main():
    X = int(input())
    for k in range(1, 361):
        d, m = divmod(X*k, 360)
        # print(d, m)
        if m == 0:
            print(k)
            return

    return


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

X = int(input())


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


n = lcm(X, 360)
print(n // X)
import math
x=int(input())
denominator=360//math.gcd(360,x)
print(denominator)
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline

import math


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

    Y = (360 * X) // math.gcd(360, X)
    print(Y // X)


if __name__ == '__main__':
    main()
n=int(input())
#n*k1=(360)*k2
#(k1/k2)=(360/n)
k=1
while((k*n)%360!=0):
  k+=1
print(k)
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    x = int(input())
    if 360 % x == 0:
        res = 360 // x
        print(res)
    else:
        q, r = divmod(360, x)
        print((360 // r) * q)


if __name__ == '__main__':
    resolve()
import math
X = int(input())
ans = 360 // math.gcd(360,X)
print(ans)
import math
X = int(input())
lcm = 360 * X // math.gcd(360, X)
print(lcm // X)
X = int(input())

for i in range(1,361):
    if (i * X)%360 == 0:
        print(i)
        exit()
import math
x=int(input())
if 360%x==0:
    print(360//x)
else:
    print(360 // math.gcd(x, 360))
from math import *
x=int(input())
k = 0
for _ in range(9999):
    k += 1
    if x * k % 360 == 0:
        print(k)
        exit()
X=int(input())
a=[]
for i in range(1,X+1):
    a.append(360*i)
for k in range(len(a)):
    if a[k]%X==0:
        print(int(a[k]//X))
        break
import sys
input = sys.stdin.readline


x = int(input())

k = 0
for i in range(1,10000):
    if x*i%360 == 0:
        k = i
        break
print(k)
x=int(input())
k=1
while (True):
  if x*k%360==0:
    print(k)
    break
  else:
    k+=1
x=int(input())
temp=360
while temp%x:
	temp+=360
print(temp//x)
# -*- coding: utf-8 -*-
x=int(input())
a=360
b=x
r=a%b
while r!=0:
  a=b
  b=r
  r=a%b
lcm=x*360/b
k=int(lcm/x)
print(k)
x=int(input())
for i in range(1,x+1):
    if 360*i%x==0:
        print(360*i//x)
        exit()
x = int(input())
ans = 0
for i in range(1, 10000):
    if (x * i) % 360 == 0:
        ans = i
        break

print(i)
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
x=int(input())
y=lcm(x,360)
print(y//x)
x = int(input())
import math
print(360//math.gcd(x, 360))
X = int(input())
ans = 0
tmp = 0
while True:
    ans += 1
    tmp += X
    if tmp % 360 == 0:
        print(ans)
        exit()
x = int(input())

for i in range(1, 361):
    if x * i % 360 == 0:
        print(i)
        break
x=int(input())
i=1
while x*i%360!=0:
  i+=1
print(i)
X = int(input())
i = 1
while True:
    if (X * i) % 360 == 0:
        break
    i += 1
print(i)
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
x = I()
ans = 0
wa = 0
cont = True
while cont:
    wa += x
    ans += 1
    if wa % 360 == 0:
        cont = False
print(ans)
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

X = ir()
answer = 0
dir = 0
while True:
    dir += X
    answer += 1
    dir %= 360
    if dir == 0:
        break

print(answer)
x = int(input())
for i in range(1,361):
  if (i*x)%360 == 0:
    print(i)
    exit()
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

X = int(input())
from math import gcd
print(360*X//gcd(360, X)//X)
import math

def move(i,j,angle):
    rad = 2*(angle/360)*math.pi
    si = i + math.cos(math.radians(angle))
    sj = j + math.sin(math.radians(angle))
    return [round(si,5),round(sj,5)]

x = int(input())

i,j = 0,0
angle = 90
ans = 0
# t=10
while 1:
    # t-=1
    i,j = move(i,j,angle)
    # print(str(i) +'  '+str(j))
    angle += x
    ans += 1
    if(i == 0 and j == 0):
        break

print(ans)
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    X=I()
    ans=360
    for i in range(1,180):
        t=360*i
        if t%X==0:
            ans=min(ans,t//X)
            
    print(ans)

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

a=int(input())
n=lcm(360,a)
print(n//a)
x=int(input())
i=0
while True:
  360*i%x!=0
  i+=1
  if 360*i%x==0:
    break
k=360*i/x
print(int(k))
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    if b == 0:
        return a
    return gcd(b, a % b)


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


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

wk = 0
cnt = 0
while True:
  wk += X
  cnt += 1
  wk %= 360
  if wk % 360 == 0:
    break
  
print(cnt)
cnt = 0
pos = 360
muki = int(input())
while pos != 0:
    pos += muki
    pos %= 360
    cnt += 1
print(cnt)
from math import gcd

x = int(input())
lcm = 360 * x // gcd(360, x)
ans = lcm // x
print(ans)
n=int(input())
dx = n
ans = 1
while dx%360>0:
  ans+=1
  dx += n
print(ans)
x=int(input())

i=1
while 1:
    if (360*i)%x==0:
        print((360*i)//x)
        exit()
    i+=1
x = int(input())
num = x
cnt = 1
while num != 0:
  num += x
  num %= 360
  cnt += 1

print(cnt)
import math
n=int(input())
ans=0
count=0
while True:
  if ans!=0 and ans%360==0:
    break
  else:
    count+=1
    ans+=n
print(count)
X = int(input())
A = X
ans = 1
while A % 360 != 0:
    A += X
    ans += 1
print(ans)
def main2():
    x = int(input())

    k = 1
    while x*k % 360 != 0:
        k += 1

    print(k)

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

d = 0
c = 0
while 1:
    c += 1
    d += X
    d %= 360
    if d==0:
        break
print(c)
X = int(input())
t = X
ans = 1
while t%360 != 0:
    t += X
    ans += 1
print(ans)
x = int(input())

k = 1
while True:
    if k*x % 360 ==0:
        print(k)
        exit(0)
    k += 1
X=int(input())
from math import*
ans=X*360//gcd(X,360)//X
print(ans)
X = int(input())
ls = [2, 2, 2, 3, 3, 5]
a = []
for l in ls:
  if X % l == 0:
    a.append(l)
    X /= l
num = 1
if len(a) != 0:
  for b in a:
    num *= b
print(int(360 / num))
x=int(input())
k=1
while (k*x)%360!=0:
  k+=1
print(k)
import math

x=int(input())
print(360//math.gcd(x,360))
import math


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


X = int(input())
print(lcm(360, X) // X)
import math
X = int(input())
print((X*360//math.gcd(X, 360))//X)
X = int(input())
cur = X
cnt = 1
while cur % 360:
    cur += X
    cur %= 360
    cnt += 1
print(cnt)
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)
from math import gcd,ceil

def lcm(a,b):return a*b//gcd(a,b)
x=int(input().rstrip())
print(360//x if 360%x==0 else (lcm(360,x)//x))
from math import gcd

X = int(input())

ans = 360 // gcd(360, X)
print(ans)
n = int(input())
from math import gcd

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

if 360%(n)==0:
    print(360//n)
else:
    print(lcm(360,n)//n)
from math import gcd
def lcm(a,b):
    return a//gcd(a,b)*b
x=int(input())
print(lcm(360,x)//x)
x = int(input())
t = 360
while t % x > 0:
    t += 360
print(t // x)
import  math
x=int(input())
lcm=(x*360)//math.gcd(x,360)
ans=lcm//x
print(ans)
x = int(input())
for i in range(1, 10**5):
    if x*i%360==0:
        print(i)
        exit(0)
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
from functools import lru_cache
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7 

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    X = int(input())
    print(X * 360 // math.gcd(360, X) // X)    


if __name__ == "__main__":
    main()
def main():
    # n = int(input())
    # h, w, k = map(int, input().split())
    # a = list(map(int, input().split()))
    # s = input()
    x = int(input())
    i = 1
    while (x*i) % 360 != 0:
        i += 1
    print(i)


if __name__ == '__main__':
    main()
def gcd(a, b):
  if a < b:
    a, b = b, a
  while b:
    a, b = b, a % b
  return a

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


X = int(input())
print(g(X, 360) // X)
import math

x = int(input())


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


rad = lcm(360, x)
print(rad//x)
X = int(input())

cnt = 0
x = 0
while True:
    x += X
    cnt += 1
    if x % 360 == 0:
        print(cnt)
        exit()
import sys
import math
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))

n = ini()
count = n
ans = 1
while count != 0:
    count = (count + n) % 360
    ans += 1
print(ans)
def g(a,b):
    if a*b:
        if a>b:
            return g(a-b,b)
        elif(a<b):
            return g(a,b-a)
        else:
            return a
    else:
        if(a*b):
            return max(a,b)
        else:
            return 1
n=int(input())
print(360//g(n,360))
x = int(input())
k = 1
while k*x%360:
    k += 1

print(k)
X = int(input())

K=1
y=X % 360
while y != 0:
  K+=1
  y=(y+X)% 360
#
print(K)
X = int(input())
ans = 0
d = 0
while True:
    d += X
    ans += 1
    if d%360==0:
        print(ans)
        exit()
import math
N = int(input())
LCM = N*360//math.gcd(N,360)
ans = LCM//N
print(ans)
x=int(input(""))
import math
a=math.gcd(360,x)
print(int(360/a))
import numpy as np

input_rad = int(input())
X, Y = 0, 0
Y = 1
t = 1
rad = input_rad

while True:
    radian = rad * np.pi / 180
    x = np.sin(radian)
    y = np.cos(radian)
    X += x
    Y += y
    t += 1
    rad += input_rad
    if abs(X) < 1.0 * np.exp(-5):
        X = 0
    if abs(Y) < 1.0 * np.exp(-5):
        Y = 0
    if X == 0:
        if Y == 0:
            print(t)
            break
a=int(input())
b=a
c=1
while b!=0:
    b=b+a
    b=b%360
    c=c+1
print(c)
X = int(input())
cnt = 1
t = X
while t % 360 != 0:
    t += X
    cnt += 1

print(cnt)
import math

x = int(input())
a = math.gcd(360,x)
b = int(x/a)
c= int(360/a)
d = c*b
print(c)
X = int(input())

def calc(X):
	n = 1
	while True:
		if 360 * n % X == 0:
			return 360 * n // X
		n += 1

print(calc(X))

#for z in range(1, 180):
#	print(z, calc(z))
import math
X = int(input())
print(360//math.gcd(360,X))
import math

x = int(input())
print(360 // math.gcd(x, 360))
x=int(input())
a=x
i=0
while True:
    if x%360==0:
        print(i+1)
        break
    x+=a
    i+=1
import numpy as np

x = int(input())

d = 180 - x
ans = 360 // np.gcd(360, 180-d)
print(ans)
X = int(input())
tmp = 360
while True:
    if tmp % X == 0:
        print(tmp//X)
        exit()
    else:
        tmp+= 360
n = int(input())

from fractions import gcd
x = n * 360 // gcd(n, 360) # float

print(x//n)
from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt
import math

import bisect
import re
import heapq


from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


yes = "Yes"
no = "No"


def main():
    x = ii()
    for i in range(1,400):
        if (x*i) % 360 == 0:
            print(i)
            exit()




main()
def main():
    X = int(input())
    k = 1
    while k*X % 360 != 0:
        k += 1
    print(k)


if __name__ == '__main__':
    main()
import sys 
import collections

X = int(input())

Angle = 360
for i in range(1,10**9):

    if Angle < (X*i):
        Angle = Angle + 360 

    if (Angle / (X*i)) == 1:
        print(i)
        sys.exit()
X = int(input())

angle = 0
count = 0
while True:
    angle += X
    count += 1
    if angle % 360 == 0:
        break

print(count)
x = int(input())
count = 0
degree = 360
while degree!=0:
  if degree < 0:
    degree += 360
  degree = degree -x
  count +=1

print(count)
x=int(input())
X=x
k=1
while X%360!=0:
    k+=1
    X+=x
print(k)
from math import *

X=int(input())
print(360//gcd(360,X))
n=int(input())
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)
g=gcd(n,360)
print(int(360/g))
X=int(input())
for i in range(1,361):
  if (X*i)%360==0:
    print(i)
    break
x = int(input())
n = 1
while 360 * n % x != 0:
    n += 1
print(n * 360 // x)
X=int(input())
i=1
a=0
while True:
  a=a+X
  if a%360==0:
    print(i)
    break
  i+=1
def compute_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
n=int(input())
if(n%360==0):
  print(n//360)
else:
  print(compute_lcm(n,360)//n)