#!/usr/bin/env python3 # %% import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from collections import defaultdict from math import gcd # %% N, *A = map(int, read().split()) # %% dp = defaultdict(int) for x in A: newdp = defaultdict(int) newdp[x] = 1 for key, value in dp.items(): newdp[key] += value newdp[gcd(key, x)] += value dp = newdp # %% print(dp[1])