import Data.List (group)

main :: IO ()
main = do
  [n, m] <- map read . words <$> getLine
  print $ f n m

f :: Int -> Int -> Int
f n m = product $ map ((\b -> nCombinations (b + n - 1) b) . length) $ group $ factors m

factors :: Integral a => a -> [a]
factors = factors' primes
  where
    factors' pps@(p:ps) n
      | n < 2              = []
      | n < p ^ (2 :: Int) = [n]  -- stop early
      | n `mod` p == 0     = p : factors' pps (n `div` p)
      | otherwise          = factors' ps n
    factors' _ _ = error "`primes` is a infinite list"

primes :: Integral a => [a]
primes = 2 : filter (\n -> head (factors n) == n) [3, 5 ..]

nCombinations :: Integral a => a -> a -> a
nCombinations _ 0 = 1
nCombinations n k
  | n == k    = 1
  | otherwise = nCombinations (n - 1) (k - 1) + nCombinations (n - 1) k
