class Problem
  attr_accessor :a, :b, :n, :m, :h, :w, :ans, :c ,:x, :y
  def initialize
    @n = gets.to_s.to_i
    @m = Math.sqrt(n).to_i
  end

  def solve
    puts calc
  end

  def calc
    ans = 0
    each do |i,j|
      ans += j - 1 if i < j - 1
    end
    ans
  end

  def each
    i = 1
    while i * i <= n
      if n % i == 0
        yield n / i, i
        yield i, n / i
      end
      i += 1
    end
  end

end

pb = Problem.new
pb.solve
