from typing import List, Tuple, Callable, TypeVar import sys import itertools import heapq import bisect import math from collections import deque, defaultdict, Counter from functools import lru_cache, cmp_to_key input = sys.stdin.readline if __file__ != 'prog.py': sys.setrecursionlimit(10 ** 6) def readints(): return map(int, input().split()) def readlist(): return list(readints()) def readstr(): return input()[:-1] class Osa_k: # N以下の整数を素因数分解 O(NlogN) def __init__(self, N): self.min_factor = [i for i in range(N + 1)] for i in range(2, N + 1): if i * i > N: break if self.min_factor[i] == i: for j in range(2, N + 1): if i * j > N: break if self.min_factor[i * j] > i: self.min_factor[i * j] = i def factors(self, n): f = [] while n > 1: f.append(self.min_factor[n]) n //= self.min_factor[n] return f N = int(input()) A = readlist() mod = 998244353 osa_k = Osa_k(10 ** 6) S = defaultdict(int) ans = 0 for a in A: acc = 1 factors = set(osa_k.factors(a)) for f in factors: acc += S[f] acc %= mod for f in factors: S[f] += acc S[f] %= mod ans += acc ans %= mod print(ans)