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):
x = int(input())

cur = x
k = 1
while cur != 0:
    cur = (cur + x) % 360
    k += 1

print(k)

Solution (Python):
def examA():
    def gcd(x, y):
        if y == 0:
            return x
        while (y != 0):
            x, y = y, x % y
        return x
    X = I()
    G = gcd(X,360)
    ans = 360//G
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return


from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examA()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

from decimal import *
import heapq
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

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

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

ans = 1
angle = x
while angle != 0:
    ans += 1
    angle += x
    angle %= 360

print(ans)

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

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

arg = 360
for i in range(1,370):
    if arg*i % X == 0:
        print((arg*i)//X)
        exit()

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

Solution (Python):
def gcd(a: int, b: int) -> int:
    """a, bの最大公約数(greatest common divisor: GCD)を求める
    計算量: O(log(min(a, b)))
    """
    while b:
        a, b = b, a % b
    return a


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

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

A=1
while (A*X)%360:
    A+=1

print(A)

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

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

Solution (Python):
X=int(input())
for i in range(1,361):
  if (X*i)%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())
x=0
for i in range(360):
    x+=X
    if x%360==0:
        break
print(i+1)

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

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

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

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

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

Solution (Python):
import sys
from math import gcd

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

X = int(readline())

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

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

Solution (Python):

import sys
from math import gcd
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

X=int(input())
g=gcd(X,360)
l=X*360//g
print(l//X)

Solution (Python):
n = int(input())
now = 0
for i in range(1,10000):
  now += n
  if now % 360 == 0:
    print(i)
    exit()

Solution (Python):
x=int(input())
def gcd(a,b):
  while b:a,b=b,a%b
  return a
g=gcd(x,360)
print(360//g)