func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, a[2006];   int one, g, mn = 1e9;   int gcd(int _a, int _b) { return _b == 0 ? _a : gcd(_b, _a % _b); }   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       scanf( %d , &a[i]);       g = gcd(g, a[i]);       if (a[i] == 1) one++;     }     if (one != 0) {       printf( %d n , n - one);       return 0;     }     if (g != 1) {       puts( -1 );       return 0;     }     for (int i = 1; i <= n; i++) {       int b = a[i];       for (int j = i + 1; j <= n; j++) {         b = gcd(b, a[j]);         if (b == 1) {           mn = min(mn, j - i);           break;         }       }     }     printf( %d n , mn + n - 1);     return 0;   }   