#include #include using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 10000000000000 int main(){ int N; cin>>N; vector c1(2,0),c2(2,0); int n = N; rep(i,2){ rep(j,N){ int a; cin>>a; if(a==1)c1[i]++; else if(a==2)c2[i]++; else n--; } } int ans =N*(c2[0]); if(ans!=0)ans += c1[0]; else ans += max(c1[0],c1[1]); { int t = N*(c1[0]); if(t!=0)t += c1[1]; else t += max(c1[0],c1[1]); ans = min(ans,t); } cout<