program main
Implicit None
	integer(8)::n,a=1,p=0
	
	read*,n
	
	do
		if((n/a-1) < a) exit
		if(mod(n,a) == 0)then
			if((n/a-1) > a) p = p + n/a-1
		endif
		a = a+1
	enddo
	print"(i0)",p
end program main