#include #include #include using namespace std; using ll = long long; template T gcd_(T a, T b) { while (b) { T tmp = b; b = a % b; a = tmp; } return a; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector a(n); for (int i = 0; i < n; i++) cin >> a[i]; map dp; for (int x : a) { for (auto& p : dp) { dp[gcd_(p.first, x)] += p.second; } dp[x]++; } cout << dp[1] << endl; return 0; }