//
#include "bits/stdc++.h"
using namespace std;
#define pr1(a) for(auto b : a) cout << b << " ";cout << endl;
#define pr2(a) for(auto b : a){for(auto c:b) cout << c << " ";cout << endl;}
#define prc(...) for(auto b:{ __VA_ARGS__ }) cout << b << " ";cout << endl;

const int NN=200000;
vector<vector<int>> g(NN+1,vector<int>());
vector<bool> visited(NN+1,false);
long long ans=0;

void dfs(int p){
    for(auto e:g[p]){
        if (visited[e]==false){
            ans++;
            visited[e]=true;
            dfs(e);
        }
    }
}

void solve()
{
    fill(g.begin(),g.end(),vector<int>());
    fill(visited.begin(),visited.end(),false);
    ans=0;
    int a,b,n,val;
    cin >> n ;
    vector<int> d(n);
    for(int &i:d) cin>>i;
    for(int i=0;i<n/2;i++){
        int v1=d[i], v2=d[n-i-1];
        if (v1!=v2){
            g[v1].push_back(v2);
            g[v2].push_back(v1);
        }
    }
    for(int i=0;i<=NN;i++){
        if (visited[i]==false)
            visited[i]=true;
            dfs(i);
    }
    
    cout<<ans<<endl;
}

int main()
{
    ios_base::sync_with_stdio(0);    cin.tie(0);    cout.tie(0);
#ifndef ONLINE_JUDGE
    stringstream in(R"(3
8
1 5 3 2 5 2 3 1
7
1 2 3 4 1 2 3
1
200000
)"); //ans 2 1 0
    std::cin.rdbuf(in.rdbuf());
#endif
    int tn = 1;
    //cin >> tn;
    while (tn--)
        solve();
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<ll, ll> pl;
struct edge {
    ll to;     // 辺の行き先
    ll weight; // 辺の重み
    edge(ll t, ll w) : to(t), weight(w) { }
};
typedef vector<vector<ll> > Graph;
typedef vector<vector<edge> > WGraph;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep3(i, k, n) for(int i = k; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define pb push_back
#define vout(v) for(int index_vout=0; index_vout < v.size(); index_vout++) cout<<v[index_vout]<<' '
#define blank cout<<endl
#define newvar(n) ll n; cin >> n
#define uniquify(vec) (vec).erase(std::unique((vec).begin(), (vec).end()), (vec).end())
const ll MOD = 1e9 + 7;
const ll INF = MOD*MOD+1;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vl M(n+1, 0);
    for(ll i = 1; i <= n; i++){
        M[i]++;
        cout << M[i] << ' ';
        for(ll j = 2*i; j <= n; j += i){
            M[j] = max(M[j], M[i]);
        }
    }

    return 0;
}
