from collections import defaultdict, deque from heapq import heappush, heappop from itertools import permutations, accumulate import sys import math import bisect def LI(): return [int(x) for x in sys.stdin.readline().split()] def I(): return int(sys.stdin.readline()) def IR(n): return [I() for _ in range(n)] def LIR(n): return [LI() for _ in range(n)] sys.setrecursionlimit(1000000) mod = 998244353 def factorize(n): res = {} p = 2 while 1: if p*p > n: break if n%p: p += 1 continue s = 0 while n%p == 0: n //= p s += 1 res[p] = s p += 1 if n > 1: res[n] = 1 return res def main(): n = I() a = LI() ans = 0 su = defaultdict(lambda: 0) for i in a: f = factorize(i) s = 1 for i in f.keys(): s += su[i] if s >= mod: s -= mod for i in f.keys(): su[i] += s if su[i] >= mod: su[i] -= mod ans += s if ans >= mod: ans -= mod print(ans) return if __name__ == "__main__": main()