#include<iostream>
#include<algorithm>
#include<string>
#include<cstdio>
#include<vector>
#include<queue>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define pb push_back
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a);
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a);
#define sor(vec) sort(vec.begin(),vec.end())
#define rev(vec) reverse(vec.begin(),vec.end())
#define pque(x) priority_queue<x>
#define rpque(x) priority_queue<x,vector<x>,greater<x>>


int main(){
	while(1){
		int n;
		int A,B;
		vector<int> veca,vecb;
		
		scanf("%d",&n); if(n==0)break;
		rep(i,n){
			scanf("%d",&A);
			veca.pb(A);
		}
		rep(i,n){
			scanf("%d",&B);
			vecb.pb(B);
		}
		sor(veca);
		rev(veca);
		sor(vecb);
		rev(vecb);
		
		static int a[40010];
		static int b[40010];
		static int c[40010]; rep(i,40010)c[i]=-1;
		int loca=0;
		int locb=1;
		
		rep1(i,n)a[i]=veca[i-1];
		rep1(i,n)b[i]=vecb[i-1];
		
		int ret=-1;
		rep1(k,n/2){
			if(loca==k-1)loca++;
			else {
				c[loca]=c[k-1];
				loca++;
			}
			while(loca<=2*k-1&&locb<=n&&a[loca]<=b[locb]){
				c[loca]=b[locb];
				loca++;
				locb++;
			}
			if(loca<=2*k-1){ret=2*k-1; break;}
			/*printf("%d %d %d\n",k,loca,locb);
			rep1(i,n){
				printf("%d ",c[i]);
			}
			printf("\n");*/
		}
		if(ret==-1)printf("NA\n");
		else printf("%d\n",ret);
	}
}