n = gets.to_i a = 0 b = 0 (1..n).each do|i| next unless n % i == 0 a += i b += 1r / i end puts( (a/b).to_i)