Problem:
Problem J: No Story

Since I got tired to write long problem statements, I decided to make this problem statement short. For given positive integer L, how many pairs of positive integers a, b (a ≤ b) such that LCM(a, b) = L are there? Here, LCM(a, b) stands for the least common multiple of a and b.

Input

For each dataset, an integer L is given in a line. Input terminates when L = 0.

Output

For each dataset, output the number of pairs of a and b.

Constraints

1 ≤ L ≤ 1012

Sample Input

12
9
2
0

Output for the Sample Input

8
3
2

Solution in Ruby (judge verdict: Wrong Answer)

### constant

MAX_P = 10 ** 6

### subroutines

def gen_primes(max_p)
  primes = Array.new(max_p + 1){true}
  primes[0] = primes[1] = false

  s_max_p = Math.sqrt(max_p + 0.5).to_i

  for p in (2..s_max_p)
    if primes[p]
      for q in (p * p).step(max_p, p)
        primes[q] = false
      end
    end
  end

  primes
end

### main

primes = gen_primes(MAX_P)
pnums = (2..MAX_P).select{|p| primes[p]}
#p pnums.length; exit

loop do
  l = gets.to_i
  break if l == 0

  count = 1

  for pn in pnums
    break if l == 1

    f = 0
    while l % pn == 0
      l /= pn
      f += 1
    end

    if f > 0
      count *= ((f + 1) * 2 - 1)
    end
  end

  puts (count + 1) / 2
end