#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
#define first first
#define second se
using namespace std;
typedef pair<int, int> P;
typedef vector<int> vi;

signed main(){
    int n;
    cin >> n;
    int l = 1;
    vector<int> a(n);
    rep(i, 0, n){
        cin >> a[i];
    }
    rep(i, 1, n){
        if(a[i] != a[i % l]){
            l = i + 1;
        }
    }
    if(n % l) cout << 1 << endl;
    else cout << n / l << endl;
}