Problem:
 Score : 200 points    Problem Statement Takahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer K such that Takahashi will be at the starting position again after he does the following action K times:   Go one meter in the direction he is facing. Then, turn X degrees counter-clockwise.       Constraints  1 \leq X \leq 179  X is an integer.         Input Input is given from Standard Input in the following format:  X       Output Print the number of times Takahashi will do the action before he is at the starting position again.        Sample Input 1 90      Sample Output 1 4  Takahashi's path is a square.       Sample Input 2 1      Sample Output 2 360

Solution (Python):
import math

if __name__ == "__main__":
    deg = int(input())
    print(360//math.gcd(deg, 360))

Solution (Python):
x=int(input())
from math import gcd
x=gcd(x,360)
print(360//x)

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

Solution (Python):
x = int(input())
import numpy as np
print(np.lcm(x, 360) // x)

Solution (Python):


X = int(input())
Y, K = 0, 0
while True:
  Y += X
  K += 1
  if Y % 360 == 0:
    print(K)
    exit()

Solution (Python):
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))

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

Solution (Python):
from math import gcd
X = int(input())
print(360 // gcd(360, X))

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

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

Solution (Python):
X = int(input())
ROTATION = 360

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

print(K)

Solution (Python):
x = int(input())
for i in range(1,1000):
  if (360*i)%x == 0:
    print((360*i)//x)
    exit()

Solution (Python):

import math

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

Solution (Python):
x=int(input())

for i in range(1,100000):
  if 360*i%x==0:
    print((i*360)//x)
    break

Solution (Python):
x = int(input())
y = 0
k = 0
while True:
    y += x
    k += 1
    if y % 360 == 0:
        break
print(k)

Solution (Python):
from math import gcd

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

Solution (Python):
import math
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


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

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


if __name__ == "__main__":
    main()

Solution (Python):
import numpy as np

import math

import collections

if __name__ == '__main__':
    n = int(input())
    print(int(np.lcm(360,n)/n))

Solution (Python):
import sys
import itertools

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



MOD = 10 ** 4 + 7

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

Solution (Python):

x = int(input())
r = 0
for k in range(360):
    r += x
    if r % 360 == 0:
        break
print(k + 1)

Solution (Python):
def solve(x):
    k = 1
    while k*x % 360 != 0:
        k += 1
    return k

x = int(input())
print(solve(x))

Solution (Python):
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()

Solution (Python):
dir = int(input())
x = 360
ans = 0

while x != 0:
  if x < 360:
    x += 360
  ans = ans + (x // dir)
  x = x % dir

print(ans)

Solution (Python):
X = int(input())

k = 0
for i in range(360):
    k += X
    if k % 360 == 0:
        print(i+1)
        break

Solution (Python):
import math
print(360//math.gcd(360,int(input())))

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

Solution (Python):
X = int(input())

wk = 0
cnt = 0
while True:
  wk += X
  cnt += 1
  wk %= 360
  if wk % 360 == 0:
    break
  
print(cnt)

Solution (Python):
X = int(input())

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

Solution (Python):
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)

Solution (Python):
X = int(input())
cnt = 1
t = X
while t % 360 != 0:
    t += X
    cnt += 1

print(cnt)

Solution (Python):
n = int(input())
for i in range(1,361):
    if n*i%360 == 0:
        print(i)
        break

Solution (Python):
from math import gcd
x=int(input())
print(360//gcd(360,x))

Solution (Python):
x = int(input())
for i in range(1, 100000):
  if x * i % 360 == 0:
    print(i)
    exit()

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re











import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
X = I()
lcm = 360 * X // gcd(360,X)
print(lcm//X)

Solution (Python):
import math
x = int(input())
print(((x*360)//math.gcd(x,360))//x)

Solution (Python):
x = int(input())

import math
from functools import reduce
def lcm_base(x, y):
  
  return (x * y) // math.gcd(x, y)

l = lcm_base(x, 360)
print(l//x)

Solution (Python):
X = int(input())
import math
ans = 360 // math.gcd(X, 360)
print(ans)

Solution (Python):
import sys
from fractions import gcd

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


X = ini()


def solve():
    y = gcd(360, X)
    return 360 // y


print(solve())

Solution (Python):
x = int(input())

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

Solution (Python):
from math import gcd

X = int(input())

print(360//gcd(X,360))

Solution (Python):
import math
n=int(input())
print(360//math.gcd(n,360))

Solution (Python):
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()

Solution (Python):
x=int(input())
import math
K=360//math.gcd(x,360)
print(K)

Solution (Python):
from fractions import gcd
X = int(input())
print(int(360/gcd(X, 360)))

Solution (Python):
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)

Solution (Python):
cnt=0
radi=0
x=int(input())
while True:
  cnt+=1
  radi+=x
  radi%=360
  if radi==0:
    print(cnt)
    break

Solution (Python):

x = int(input())
i = 1

while True:
  if 360 * i % x == 0:
    print(360 * i // x)
    break
  else:
    i += 1

Solution (Python):
def gcd(a,b):
    for i in range(1,min(a,b)+1):
        if a%i ==0 and b % i ==0:
            ans = i
    return ans

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

Solution (Python):
import math

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

Solution (Python):
x = int(input())
import math
print(360*x//math.gcd(360,x)//x)

Solution (Python):
import math
x = int(input())
s =  x * 360 / math.gcd(x, 360)
print(int(s//x))

Solution (Python):
from sys import stdin
x = int(stdin.readline().rstrip())

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

ans = int(lcm(x, 360) / x)
print(ans)

Solution (Python):
x = int(input())
i = x
count = 1
while True:
    if i % 360 == 0:
        print(count)
        exit()
    i += x
    count += 1

Solution (Python):
from math import gcd
X = int(input())

lcm = 360 * X // gcd(360,X)
print(lcm//X)

Solution (Python):
import sys
x = int(input())
ans = 2
while(True):
    if x*ans % 360 == 0:
        print(ans)
        sys.exit()
    ans +=1

Solution (Python):
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()

Solution (Python):
import math

x = int(input())
y = 360

lcm = x * y // math.gcd(x, y)
print(lcm//x)

Solution (Python):
import math

x = int(input())
y = 360

lcm = x * y // math.gcd(x, y)
print(lcm//x)

Solution (Python):
x=int(input())
ans=1
while True:
  if x*ans%360==0:
    print(ans)
    break
  else:
    ans=ans+1

Solution (Python):
x = int(input())
k = 1
while (x*k)%360 != 0:
  k+=1
print(k)

Solution (Python):
x = int(input())

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

Solution (Python):
import math
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


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


if __name__ == "__main__":
    main()

Solution (Python):

x = int(input())
for i in range(360):
    k = i + 1
    if x * k % 360 == 0:
        print(k)
        exit()

Solution (Python):




    

n=int(input())
if n%360==0:
    print(0)
    exit()
else:
    var=1
    while (var*n)%360!=0:
        var+=1
    print(var)

Solution (Python):
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)
    
  return i


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

print(f(int(input())))

Solution (Python):
X = int(input())

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

Solution (Python):
X=int(input())
i=1
while i*X % 360 != 0:
	i+=1
print(i)

Solution (Python):
x = int(input())
j = 0
for i in range(360):
  j += x
  j %= 360
  if j == 0:
    print(i+1)
    exit()

Solution (Python):
x = int(input())

ans = 0
tmp = 0
while True:
    ans += 1
    tmp += x
    if tmp % 360 == 0:
        break
print(ans)

Solution (Python):
import math

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

Solution (Python):

import math
n = int(input())

circle = n * 360 // math.gcd(360,n)

print(circle // n)

Solution (Python):
from sys import stdin, setrecursionlimit
input = stdin.buffer.readline
setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

MOD = 10 ** 9 + 7
INF = 10 ** 18

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(X, 360) // X)

Solution (Python):
from math import gcd
def lcm(a,b):
    return a//gcd(a,b)*b
x=int(input())
print(lcm(360,x)//x)

Solution (Python):
x = int(input())

idx = 0
tmp = 0
while 1:
    tmp += x
    idx += 1
    if tmp % 360 == 0:
        break

print(idx)

Solution (Python):
X = int(input())
ret = 0
cur = 0
while True:
    ret += 1
    cur += X
    if cur % 360 == 0:
        print(ret)
        break

Solution (Python):
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())
ans = lcm(x, 360) // x
print(ans)

Solution (Python):
import sys
import math


def main(X=None):
    """
    >>> main(90)
    4
    >>> main(120)
    3
    >>> main(45)
    8
    >>> main(1)
    360
    >>> main(70)
    36
    """
    if not X:
        X = int(input())
    
    
    
    
    
    
    
    ret = 0
    cur = 0
    while True:
        ret += 1
        cur += X
        if cur % 360 == 0:
            print(ret)
            return


def _test():
    import doctest
    doctest.testmod()


USE_NUMBA = False
if USE_NUMBA and sys.argv[-1] == 'ONLINE_JUDGE' or sys.argv[-1] == '-c':
    print("compiling")
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', 'void(i8,i8)')(main)
    
    cc.compile()
    exit()
else:
    if USE_NUMBA and sys.argv[-1] != '-p':
        
        
        from my_module import main  
    elif sys.argv[-1] == "-t":
        _test()
        sys.exit()
    elif len(sys.argv) == 2:
        
        input_as_file = open(sys.argv[1])
        input = input_as_file.buffer.readline

    
    main()

Solution (Python):
from math import gcd
x = int(input())

k = x * 360 // gcd(x, 360)
print(k // x)

Solution (Python):
import sys
X = int(input())
for i in range(1,1000):
  if 360*i % X == 0:
    print(360*i//X)
    sys.exit()

Solution (Python):

x = int(input())
ans = x
ans2 = 0

print
for i in range(1, 1000):
    temp = ans * i
    if temp % 360 == 0:
        ans2 = i
        break

print(ans2)

Solution (Python):
import math
X = int(input())
g = math.gcd(360, X)
print(360//g)

Solution (Python):
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))

Solution (Python):
X = int(input())
i = 1
while (360 * i) % X != 0: i += 1
print((360 * i) // X)

Solution (Python):
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

Solution (Python):
x=int(input())
for i in range(1,200):
  i*=360
  if(i%x==0):
    print(i//x)
    exit()

Solution (Python):
import math
X=int(input())
print(360//math.gcd(X,360))

Solution (Python):
X = int(input())

x = 360
while True:
    if x % X == 0:
        print (x // X)
        break
    x += 360

Solution (Python):
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)

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

Solution (Python):
import math
n=int(input())
print(int(360/math.gcd(n,360)))

Solution (Python):
import math
n=int(input())
print(int(360/math.gcd(n,360)))

Solution (Python):
import math

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    X = ii()
    for i in range(1, 361):
        if (X*i)%360==0:
            print(i)
            return

if __name__ == '__main__':
    main()

Solution (Python):
import math
X = int(input())
lcm = X * 360 // math.gcd(X,360)
print(lcm//X)

Solution (Python):
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)

Solution (Python):
x = int(input())
k = 1
while k*x%360:
    k += 1

print(k)

Solution (Python):
from math import gcd
X = int(input())
print(360 // gcd(X, 360))

Solution (Python):
X=int(input())
Y =360
while 1:
	if Y % X == 0:
		print(Y//X)
		break
	else:
		Y += 360

Solution (Python):
x = int(input())
dum = 360-x
ans = dum
for i in range(360):
    if ans%360 == 0:
        break
    ans += dum
print(i+1)

Solution (Python):
X = int(input())
import math
ans = 360 // math.gcd(360, X)
print(ans)

Solution (Python):
X = int(input())
import math
ans = 360 // math.gcd(360, X)
print(ans)

Solution (Python):
X=int(input())
cnt=0
for i in range(1,10**7):
    cnt+=X
    if cnt%360==0:
        print(i)
        break

Solution (Python):
x = int(input())

for i in range(1, 10**5):
    if 360 * i % x == 0:
        print(360 * i // x)
        break

Solution (Python):
n=int(input())
k=1
while((k*n)%360!=0):
  k+=1
print(k)

Solution (Python):
n=int(input())


k=1
while((k*n)%360!=0):
  k+=1
print(k)

Solution (Python):
import sys
import math
import numpy as np
import functools
import operator
import collections
import itertools

X=int(input())
ans=1
for i in range(1,100000):
    if (X*i)%360==0:
        print(ans)
        sys.exit()
    ans+=1

Solution (Python):
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)

Solution (Python):
x = int(input())


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

  
n = gcd(x, 360)
print(360//n)

Solution (Python):
x = int(input())
k = 2
while k*x%360!=0:
    k += 1
print(k)

Solution (Python):
x = int(input())

for k in range(1, 10000):
    if x*k % 360 == 0:
        print(k)
        break

Solution (Python):
X = int(input())
i = 0
Y = X
while Y % 360 != 0:
  Y += X
  i += 1

i += 1  
print(i)

Solution (Python):
n = int(input())
ans = 360 / n
i = 1
while int(ans * i) != ans * i:
  i += 1
print(int(ans * i))

Solution (Python):
x = int(input())

k = 1
while True:
    if k*x % 360 ==0:
        print(k)
        exit(0)
    k += 1

Solution (Python):
def gcd(a,b):
	a,b=max(a,b),min(a,b)
	return a if b==0 else gcd(b,a%b)
x=int(input())
g=gcd(360,x)
print(360//g)

Solution (Python):
import math
n = int(input())
print(360 // math.gcd(n, 360))

Solution (Python):
 

from collections import defaultdict

import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin
if 'xrange' in dir(__builtins__):
	range = xrange

sys.setrecursionlimit(10**2)

	
def print_case_iterable(case_num, iterable):
	print("Case 

def print_case_number(case_num, iterable):
	print("Case 

def print_iterable(A):
	print (' '.join(A))

def read_int():
	return int(f.readline().strip())
def read_int_array():
	return [int(x) for x in f.readline().strip().split(" ")]
def rns():
	a =  [x for x in f.readline().split(" ")]
	return int(a[0]), a[1].strip()
def read_string():
	return list(f.readline().strip())
def ri():
	return int(f.readline().strip())
def ria():
	return [int(x) for x in f.readline().strip().split(" ")]
def rns():
	a =  [x for x in f.readline().split(" ")]
	return int(a[0]), a[1].strip()
def rs():
	return list(f.readline().strip())
def bi(x):
	return bin(x)[2:]





from collections import deque
import math
NUMBER = 10**9 + 7

def factorial(n) : 
	M = NUMBER
	f = 1
  
	for i in range(1, n + 1):  
		f = (f * i) % M 
						
	return f
def mult(a,b):
	return (a * b) % NUMBER

def minus(a , b):
	return (a - b) % NUMBER

def plus(a , b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		g, y, x = egcd(b % a, a)
		return (g, x - (b // a) * y, y)

def modinv(a):
	m = NUMBER
	g, x, y = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m
def choose(n,k):
	if n < k:
		assert false
	return  mult(factorial(n), modinv(mult(factorial(k),factorial(n-k)))) % NUMBER
from collections import deque, defaultdict 
import heapq


from types import GeneratorType
def bootstrap(f, stack=[]):
	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to

	return wrappedfunc


def dfs(g, timeIn, timeOut,depths,parents): 
	
	cnt = 0
	
	stack = [[1,0,0,0]]
	while stack:
		v,neig_i,parent,depth = stack[-1]
		parents[v] = parent
		depths[v] = depth
		
		if neig_i == 0:
			timeIn[v] = cnt    
			cnt+=1
		while neig_i < len(g[v]):
			u = g[v][neig_i]
			if u == parent:
				neig_i+=1
				continue
			stack[-1][1] = neig_i + 1
			stack.append([u,0,v,depth+1])
			break
		if neig_i == len(g[v]):
			stack.pop()
			timeOut[v] = cnt
			cnt += 1
  



cnt = 0
@bootstrap
def dfs(v,adj,timeIn, timeOut,depths,parents,parent=0,depth=0):
	global cnt
	parents[v] = parent
	depths[v] = depth
	timeIn[v] = cnt
	cnt+=1
	for u in adj[v]:
		if u == parent:
			continue
		yield dfs(u,adj,timeIn,timeOut,depths,parents,v,depth+1)
	timeOut[v] = cnt
	cnt+=1
	yield 

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

def lcm(a,b): 
    return (a*b) / gcd(a,b) 
def solution(n):
	return int(round(lcm(n,360)//n))
	
def main():
	T = 1
	
	for i in range(T):
		n = ri()
		
		
		
		

		x = solution(n)
		if 'xrange' not in dir(__builtins__):
			print(x)
		else:
			print >>output,str(x)
	if 'xrange' in dir(__builtins__):
		print(output.getvalue())
		output.close()

if 'xrange' in dir(__builtins__):
	import cStringIO
	output = cStringIO.StringIO()




if __name__ == '__main__':
	main()

Solution (Python):
from math import *

a = int(input())
t = gcd(360, a)
print(360//t)

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

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]

def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n=I()
  c=0
  x=0
  while True:
    c+=1
    x+=n
    x%=360

    if x==0:
      return c


print(main())

Solution (Python):
def gcd(a,b):
  if b == 0:return a
  return gcd(b,a%b)
 
a = int(input())
print(360//gcd(360,a))

Solution (Python):
x = int(input())

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

Solution (Python):
p = int(input())
index = 1
while True:
    if p* index % 360 == 0:
        print(index)
        break
    index += 1

Solution (Python):



from math import gcd        

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()

Solution (Python):
x=int(input())
ans=1
now=x
while now%360!=0:
    now+=x
    ans+=1
print(ans)

Solution (Python):


X = int(input())

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

Solution (Python):
from math import gcd



lcm = lambda x, y: (x * y) // gcd(x, y)

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

Solution (Python):
x=int(input())
k=1
while (True):
  if x*k%360==0:
    print(k)
    break
  else:
    k+=1

Solution (Python):
def main():
    from math import gcd

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

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


if __name__ == '__main__':
    main()

Solution (Python):
X = int(input())
for k in range(1, 361):
  if k * X % 360 == 0:
    print(k)
    break

Solution (Python):
from collections import defaultdict
from math import sin, cos, radians
it = lambda: list(map(int, input().strip().split()))
INF = float('inf')

def solve():
    X = int(input())
    ans = 0
    
    degree = 90
    
    x = y = 0
    while True:
        ans += 1
        x += cos(radians(degree))
        y += sin(radians(degree))
        degree = (degree + X) % 360
        if abs(x) < 1e-7 and abs(y) < 1e-7:
            return ans

if __name__ == '__main__':
    print(solve())

Solution (Python):
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()

Solution (Python):
import math

x = int(input())


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


rad = lcm(360, x)
print(rad//x)

Solution (Python):
import numpy;x=int(input());print(numpy.lcm(360,x)//x)

Solution (Python):
import numpy
x=int(input());print(numpy.lcm(360,x)//x)

Solution (Python):
x = int(input())
k = 1
d = x
while d % 360 != 0:
  k += 1
  d += x
print(k)

Solution (Python):
import math

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

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

Solution (Python):
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)

Solution (Python):
import math
X=int(input())
if 360 % X == 0:
    print(360//X)
else:
    k=1
    while True:
        if (X*k)%360==0:
            break
        k+=1
    print(k)

Solution (Python):
x = int(input())
from math import gcd
g = gcd(x,360)
print(360//g)

Solution (Python):
X=int(input())
from math import*
ans=X*360//gcd(X,360)//X
print(ans)

Solution (Python):
import math

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

Solution (Python):
x=int(input())
for m in range(1,180):
    if 360*m%x==0:
        print(360*m//x)
        exit(0)

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

Solution (Python):
import math

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

Solution (Python):
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()

Solution (Python):
n = int(input())
res = 1
while True:
    if (res * n) % 360 == 0:
        break
    res += 1
print(res)

Solution (Python):
x = int(input())
print([360*n//x for n in range(1, 500) if 360 * n % x == 0][0])

Solution (Python):
import math


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


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

Solution (Python):
import math
X = int(input())
gcd = math.gcd(X, 360)
lcm = X * 360 / gcd
print(int(lcm/X))

Solution (Python):
X = int(input())

K=1
y=X % 360
while y != 0:
  K+=1
  y=(y+X)% 360

print(K)

Solution (Python):
X = int(input())

K=1
y=X % 360
while y != 0:
  K+=1
  y=(y+X)% 360

print(K)

Solution (Python):
X=int(input())

import math
P=[0,1]
X0=90
for i in range(1,361):
    X0+=X
    P[0]+=math.cos(X0/180*math.pi)
    P[1]+=math.sin(X0/180*math.pi)
    if abs(P[0])<1e-10 and abs(1-P[1])<1e-10:
        print(i)
        break

Solution (Python):

import sys


def solve(X: int):
    target = 360
    count = 0
    while True:
        mod = target % X
        div = target // X
        count += div
        if mod == 0:
            break
        else:
            target = 360 + mod

    print(count)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    solve(X)

if __name__ == '__main__':
    main()

Solution (Python):
import math
n = int(input())
print(360 // math.gcd(360, n))

Solution (Python):
from math import gcd
X = int(input())

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

print(lcm(X, 360) // X)

Solution (Python):
x = int(input())
for i in range(1000):
    if x * (i+1) % 360 == 0:
        print(i+1)
        exit()

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

X = i()
print(lcm(X,360)//X)

Solution (Python):
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()

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

Solution (Python):
X = int(input())
if 360 % X == 0:
  ans = int(360 / X)
else:
  import math
  kaku = (360 * X) / math.gcd(360, X)
  ans = int(kaku / X)
print(ans)

Solution (Python):
def gcd(a, b):
  if a < b:
    a, b = b, a
  while a % b:
    a, b = b, a % b
  return b

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

Solution (Python):
import math

x = input()
x = int(x)

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

print(lcd//x)

Solution (Python):
import math
x=int(input())
if 360%x==0:
    print(360//x)
else:
    LCM=(360*x)//math.gcd(360,x)
    print(LCM//x)

Solution (Python):
cnt = 0
pos = 360
muki = int(input())
while pos != 0:
    pos += muki
    pos %= 360
    cnt += 1
print(cnt)

Solution (Python):
import math

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

Solution (Python):
x = int(input())

k = 1
while True:
    if x*k % 360 == 0:
        print(k)
        exit()
    k += 1

Solution (Python):
import math
x=int(input())
print(x*360//(math.gcd(x,360))//x)

Solution (Python):
import math

x = int(input())

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

print(z//x)

Solution (Python):
import math

x=int(input())
G=math.gcd(x,360)
L=x*360//G
ans=L//x
print(ans)

Solution (Python):
X = int(input())
 
for k in range(1, 361):
  if (k * X) % 360 == 0:
    print(k)
    break

Solution (Python):
import math
X = int(input())

for k in range(1, 361):
  if (k * X) % 360 == 0:
    print(k)
    break

Solution (Python):
import sys
INF = 1 << 60
MOD = 10**9 + 7 
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
from math import gcd
def resolve():
    x = int(input())
    g = gcd(x, 360)
    print(360 // g)
resolve()

Solution (Python):
def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)
ans = 360 // (gcd(360, int(input())))
print(ans)

Solution (Python):
def gcd(a,b):
    
    if a>b:
        a,b = b,a
    if b%a==0:
        return a
    
    return gcd(a,b%a)
print(360//(gcd(360,int(input()))))

Solution (Python):
x = int(input())

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

Solution (Python):
X = int(input())

n = 1
nX = [X]
k = 360
mk = [360]

while True:
    if mk.count(nX[-1]) == 1:
        print(n)
        break
    n += 1
    mk.append(n * k)
    nX.append(n * X)

Solution (Python):
x = int(input())
for i in range(1,361):
  if (x*i)%360 == 0:
    print(i)
    exit()

Solution (Python):

import sys, re
from decimal import *
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, floor, trunc, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


x = INT()
ans = 360
for i in range(1, 361):
    if((360*i)%x==0):
        ans = (360*i)//x
        break
print(ans)


'''

k = (360*n)/x

if x==7
    n is 7
    
    


'''