#include "bits/stdc++.h" #define REP(i,n,N) for(ll i=(n); i<(N); i++) #define RREP(i,n,N) for(ll i=(N-1); i>=n; i--) #define CK(n,a,b) ((a)<=(n)&&(n)<(b)) #define ALL(v) (v).begin(),(v).end() #define p(s) cout<<(s)<>Nw) { priority_queue> pq; REP(i, 0, Nw) { int w; cin >> w; pq.push({w, 0}); } cin >> Nb; REP(i, 0, Nb) { int b; cin >> b; pq.push({b, 1}); } int len = pq.top().first; int col = pq.top().second; pq.pop(); int ans = 1; while (!pq.empty()) { int nlen = pq.top().first; int ncol = pq.top().second; if (ncol == col || nlen == len) { pq.pop(); continue; } len = nlen; col = ncol; pq.pop(); ans++; } p(ans); } return 0; }