# 8
n = int(input()[1:-1])

for i in range(1,n):
    sub = n
    ok = True
    while(sub!=0):
        re = sub%i
        sub %= i
        if re!= 1:
            ok = False
            break
    if ok:
        print(i)
        break
22c73d685ede8e4374b4c0a91188d85b272ec30d
<mask token>

<mask token>
for i in range(1, n):
    sub = n
    ok = True
    while sub != 0:
        re = sub % i
        sub %= i
        if re != 1:
            ok = False
            break
    if ok:
        print(i)
        break

n = int(input()[1:-1])
for i in range(1, n):
    sub = n
    ok = True
    while sub != 0:
        re = sub % i
        sub %= i
        if re != 1:
            ok = False
            break
    if ok:
        print(i)
        break

# 8
n = int(input()[1:-1])

for i in range(1,n):
    sub = n
    ok = True
    while(sub!=0):
        re = sub%i
        sub %= i
        if re!= 1:
            ok = False
            break
    if ok:
        print(i)
        break