#include #include #include using namespace std; int cal(vector a, vector b){ int cnt=0, pre=100, i=0, j=0; while(1){ while(1){ if(i>=a.size()) return cnt; if(a[i]=b.size()) return cnt; if(b[j] W, B; cin>> N; for(int i=0; i> x; W.push_back(x); } cin>> M; for(int i=0; i> x; B.push_back(x); } sort(W.begin(), W.end()); sort(B.begin(), B.end()); reverse(W.begin(), W.end()); reverse(B.begin(), B.end()); cout<< max(cal(W, B), cal(B, W))<< endl; return 0; }