def perf(a):
    summ = 1
    x = 2
    while x <= a:
        if a % x == 0:
            summ += x
        x += 1
    return summ / 2 == a


x = int(input())
print(perf(x))

8fc1a31146fa1377e33283d271c58144c5492a41
<mask token>

def perf(a):
    summ = 1
    x = 2
    while x <= a:
        if a % x == 0:
            summ += x
        x += 1
    return summ / 2 == a


<mask token>

def perf(a):
    summ = 1
    x = 2
    while x <= a:
        if a % x == 0:
            summ += x
        x += 1
    return summ / 2 == a


<mask token>
print(perf(x))

def perf(a):
    summ = 1
    x = 2
    while x <= a:
        if a % x == 0:
            summ += x
        x += 1
    return summ / 2 == a


x = int(input())
print(perf(x))
