#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int N = 1e6 + 5;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int n;
cin>>n;
vector<int> a(2*n+1);
map<int,int> mp;
for(int i=1;i<=2*n;i++)
{
cin>>a[i];
if(a[i]<=n)
mp[a[i]]++;
}
int sum=0;
for(auto it=mp.begin();it!=mp.end();it++)
{
if((*it).second<=2)
{
sum+=(*it).second;
}
else
sum+=2;
}
cout<<sum;
return 0;
}

京公网安备 11010502036488号