#int(input()) #map(int, input().split()) #list(map(int, input().split())) N = int(input()) A = list(map(int, input().split())) mod = 998244353 m = 10 ** 6 + 10 p = [1] * m for i in range(2, m): if p[i] != 1: continue for j in range(1, m): if i * j >= m: break p[i*j] = i a = [0] * m dp = [1] * (N) for i in range(N): b = A[i] s = set() while b != 1: t = p[b] s.add(t) b //= t for x in s: dp[i] = (dp[i] + a[x]) % mod for x in s: a[x] = (a[x] + dp[i]) % mod print(sum(dp) % mod)