import math from collections import defaultdict from copy import deepcopy def main(): n = int(input()) a = list(map(int, input().split())) dp = defaultdict(int) for x in a: new_dp = deepcopy(dp) for k, v in dp.items(): new_dp[math.gcd(k, x)] += v new_dp[x] += 1 dp = new_dp print(dp[1]) if __name__ == "__main__": main()