// 基本テンプレート
 
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
using namespace std;
 
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

const int SIZE = 1 << 17;
struct Segtree {
    int node[2 * SIZE];
    Segtree() {
        memset(node, 0, sizeof(node));
    }
    void reset() {
        memset(node, 0, sizeof(node));
    }
    void add(int x, int val) {
        x += SIZE - 1;
        node[x] += val;
        while(x > 0) {
            x = (x - 1) / 2;
            node[x] = node[2*x+1] + node[2*x+2];
        }
    }
    int query(int a, int b, int l=0, int r=SIZE, int k=0) {
        if(b <= l || r <= a) return 0;
        if(a <= l && r <= b) return node[k];
        int mid = (l + r) / 2;
        int vl = query(a, b, l, mid, 2*k+1);
        int vr = query(a, b, mid, r, 2*k+2);
        return vl + vr;
    }
};

Segtree treeone;
 
signed main() {
    int N;
    while(cin >> N, N) {
        vector<int> A(N), B(N);
        for(int i=0; i<N; i++) cin >> A[i];
        for(int i=0; i<N; i++) cin >> B[i];
        sort(A.begin(), A.end(), greater<int>());
        sort(B.begin(), B.end(), greater<int>());

        treeone.reset();
        int idxB = 0, ans = INF, draw = 0;
        for(int i=0; i<N; i++) {
            treeone.add(A[i], 1);
            // fprintf(stderr, "add %lld\n", A[i]);

            int lim = B[idxB];
            int lb = 0, ub = lim + 1;
            while(ub - lb > 1) {
                int mid = (ub + lb) / 2;
                if(treeone.query(mid, lim + 1) > 0) {
                    lb = mid;
                }
                else {
                    ub = mid;
                }
            }

            // fprintf(stderr, "lb = %lld, lim = %lld\n", lb, lim);
            if(lb > 0) {
                treeone.add(lb, -1);
                idxB++;
            }
            if(lb == lim) {
                draw++;
            }

            int match = i + 1;
            int winB = idxB - draw, winA = match - winB - draw;
            // fprintf(stderr, "match %lld: winA = %lld, winB = %lld\n", match, winA, winB);
            if(winA > match / 2) {
                ans = i + 1;
                break;
            }
        }

        if(ans >= N) cout << "NA" << endl;
        else cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 5580