#include<algorithm>
#include<cmath>
#include<cstring>
#include<iostream>
#include<cstdio>
#include<set>
using namespace std;
const int maxn=1e3;
int main()
{
    int n,a[maxn],b[maxn];
    cin>>n;;
        int sum=0,x,y,i;
        for(i=1;i<=n/2;i++){
          cin>>a[i]>>b[i];
            if(a[i]==b[i])
                sum++;
        }
    set<int>s1(a+1,a+i),s2(b+1,b+i);
    //cout<<s1.size()<<" "<<s2.size()<<endl;
        cout<<(s1.size()-1+s2.size()-1+sum)<<endl;
    return 0;
}