#include #define REP(i,n) for(int i=0,i##_len=(n);i>N; vector A(N); REP(i, N) cin >> A[i]; vector> dp(N+1); dp[0][0]=1; REP(i,N) for(auto e:dp[i]){ dp[i+1][gcd(e.first,A[i])]+=dp[i][e.first]; dp[i+1][e.first]+=dp[i][e.first]; } cout<