A=set() N=int(input()) from math import sqrt k=int(sqrt(N)) for x in range(1,k+1): t=N%x if t==0: u=x else: u=t f=u*(x+1) if f