#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int a[100005],n;
bool g;

//      3 , 4  sol = 1;
//       > 4 and < x sol = 2
//          > x sol = 3
int main (){
    cin >> n;
    for (int i = 1; i <= 2*n-2; i++){
        scanf("%d" , &a[i]);
    }
    sort (a+1 , a+2*n-1);
/*
    for (int i = 1; i <= 2*n-2; i++){
        cout << a[i] << " ";
    }
    cout << endl;
*/
    g = true;
//  cout << a[2*n-2] << " " << n << endl;
    if (a[2*n-2] == n){
//      cout << "uso sam ovde" << endl;
//        cout << 2*n << endl;
        for (int i = 2; i < 2*n; i += 2){
/*          cout << "i = " << i << endl;
            cout << 2*n << endl;
*/
            if (a[i] != a[i-1]+1){
                g = true;
                break;
            }
        }
        if (g == true){
            if (n <= 4)
                cout << 1 << endl;
            else if(n <= 8)
                cout << 2 << endl;
            else
                cout << 3 << endl;
            return 0;
        }
    }
    cout << 13 << endl;
    return 0;
}