using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { public static void Main() { Solve(); } static void Solve() { var n = long.Parse(ReadLine()); var plist = PList(n); var map = new List[plist.Count]; for (var i = 0; i < map.Length; ++i) map[i] = PList(plist[i]); var rev = new Dictionary(); for (var i = 0; i < plist.Count; ++i) rev[plist[i]] = i; var dic = PDiv(n); var primes = new List(dic.Select(kv => kv.Key)); primes.Sort(); var pcntmap = new int[plist.Count][]; for (var i = 0; i < pcntmap.Length; ++i) { pcntmap[i] = new int[primes.Count]; for (var j = 0; j < pcntmap[i].Length; ++j) { var tmp = plist[i]; while (tmp % primes[j] == 0) { ++pcntmap[i][j]; tmp /= primes[j]; } } } var mmap = new int[plist.Count][]; for (var i = 0; i < mmap.Length; ++i) { mmap[i] = new int[plist.Count]; foreach (var r in map[map.Length - 1 - i]) { if (r == 1) continue; var next = rev[plist[i] * r]; mmap[i][next] = 1; for (var q = 0; q < primes.Count; ++q) { if (pcntmap[i][q] == pcntmap[next][q]) mmap[i][next] *= (pcntmap[i][q] + 1); } } } var dp = new long[plist.Count][]; for (var i = 0; i < dp.Length; ++i) dp[i] = new long[plist.Count]; dp[0][0] = 1; var mod = 998_244_353; for (var m = 0; m + 1 < dp.Length; ++m) for (var i = 0; i + 1 < dp[m].Length; ++i) { if (dp[m][i] == 0) continue; foreach (var r in map[map.Length - 1 - i]) { if (r == 1) continue; var next = rev[plist[i] * r]; var add = dp[m][i]; dp[m + 1][next] = (dp[m + 1][next] + dp[m][i] * mmap[i][next] % mod) % mod; } } var ans = 0L; for (var i = 1; i < dp.Length; ++i) ans = (ans + dp[i][dp[i].Length - 1]) % mod; WriteLine(ans); } static List PList(long n) { var list = new List(); var rev = new List(); for (var i = 1L; i * i <= n; ++i) { if (n % i == 0) { list.Add(i); if (i * i < n) rev.Add(n / i); } } rev.Reverse(); list.AddRange(rev); return list; } static Dictionary PDiv(long n) { var dic = new Dictionary(); var tmp = n; while (tmp % 2 == 0) { tmp /= 2; if (dic.ContainsKey(2)) ++dic[2]; else dic.Add(2, 1); } for (var p = 3L; p * p <= n; p += 2) { while (tmp % p == 0) { tmp /= p; if (dic.ContainsKey(p)) ++dic[p]; else dic.Add(p, 1); } if (tmp == 1) break; } if (tmp > 1) dic.Add(tmp, 1); return dic; } }