#define _USE_MATH_DEFINES #include using namespace std; //template #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(a);i>(b);i--) #define ALL(v) (v).begin(),(v).end() typedef long long int ll; typedef pair P; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } templatevoid Fill(A(&array)[N],const T &val){fill((T*)array, (T*)(array+N), val);} const int inf = 0x3fffffff; const ll INF = 0x3fffffffffffffff; //template end map dp[61]; ll gcd(ll a,ll b){return (b?gcd(b,a%b):a);} int main(){ int n; scanf("%d",&n); vector a(n); rep(i,0,n)scanf("%d",&a[i]); dp[0][0]=1; rep(i,0,n)for(P p:dp[i]){ ll g=p.first,val=p.second; dp[i+1][g]+=dp[i][g]; dp[i+1][gcd(g,a[i])]+=dp[i][g]; } printf("%lld\n",dp[n][1]); return 0; }