#coding: UTF-8 import sys from operator import itemgetter import re import itertools import math N = input() while (N%2==0): N /= 2 flg = True for i in range(3,long(math.sqrt(N)+1)): if (N%i==0): print i flg = False break if (flg) : print N