#include #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rrep(i,n) for(int i=(int)(n-1);i>=0;i--) #define FOR(i,n,m) for(int i=n;i<=(int)(m);i++) #define RFOR(i,n,m) for(int i=(int)(n);i>=m;i--) #define all(x) (x).begin(),(x).end() #define sz(x) int(x.size()) typedef long long ll; const int INF = 1e9; const int MOD = 1e9+7; const ll LINF = 1e18; const double PI=3.14159265358979323846; using namespace std; vector dy={1,0,-1,0}; vector dx={0,1,0,-1}; template vector make_vec(size_t a){ return vector(a); } template auto make_vec(size_t a, Ts... ts){ return vector(ts...))>(a, make_vec(ts...)); } int gcd (int x,int y) { if (x < y) swap(x, y); if (y == 0) return x; return gcd(x % y, y); } int main() { int n; cin>>n; vector a(n); rep(i,n) cin>>a[i]; vector> dp(n); rep(i,n) dp[i][a[i]]=1; rep(i,n) { rep(j,i) { for(auto p:dp[j]) { dp[i][gcd(p.first,a[i])]+=p.second; } } } ll ans=0; rep(i,n) { //for(auto p:dp[i]) cout<<"dp["<