#include using namespace std; typedef long long ll; typedef long double ld; typedef pair P; typedef pair l_l; typedef vector vi; typedef vector vvi; typedef vector vl; typedef vector

vp; #define pb push_back #define sz(x) (int)(x).size() #define fi first #define se second #define rep(i,n) for(int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = 1; i <= (n); ++i) #define drep(i,n) for(int i = (n)-1; i >= 0; --i) const int INF=1001001000; const int mINF=-1001001000; const ll LINF=1010010010010010000; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } //グリッド:(典型)dp,dfs,bfs,最短経路,その他 ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;} struct SegmentTree{ int n; vector node; SegmentTree(vector v){ int sz=v.size(); n=1; while(n=0;i--){ if(node[2*i+1]==-1&&node[2*i+2]==-1)node[i]=-1; else if(node[2*i+1]==-1&&node[2*i+2]!=-1) node[i]=node[2*i+2]; else if(node[2*i+1]!=-1&&node[2*i+2]==-1)node[i]=node[2*i+1]; else node[i]=gcd(node[2*i+1],node[2*i+2]); } } void update(ll x,ll val){ x+=(n-1); node[x]=val; while(x>0){ x=(x-1)/2; node[x]=min(node[2*x+1],node[2*x+2]); } } ll getgcd(ll a,ll b,ll k=0,ll l=0,ll r=-1){ if(r<0) r=n; if(r<=a||b<=l) return -1; if(a<=l&&r<=b) return node[k]; ll v1=getgcd(a,b,2*k+1,l,(r+l)/2); ll v2=getgcd(a,b,2*k+2,(r+l)/2,r); if(v1==-1&&v2!=-1)return v2; if(v1!=-1&&v2==-1)return v1; return gcd(v1,v2); } }; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n;cin>>n; vl a(n);rep(i,n)cin>>a[i]; SegmentTree seg(a); ll j=1; ll ans=0; rep(i,n){ while(seg.getgcd(i,j)!=1&&j<=n){ j++; } if(j==n&&seg.getgcd(i,n)!=1)break; ans+=n-j+1; } cout<