#include <bits/stdc++.h>
using namespace std;
int a,d,e;
int b[500000],c[500000];
int main(){
e = 1;
cin >> a;
for(int i = 1;i <= a;i++){
cin >> b[i];
}
for(int j = 1;j <= a;j++){
cin >> c[j];
}
for(int t = 1;t <= a;t++){
if(b[t] != c[t]){
d += 1;
}
}
for(int v = 1;v <= a;v++){
if(b[a - v + 1] != c[v]){
e += 1;
}
}
if(d <= e){
cout << d << endl;
}else{
cout << e << endl;
}
return 0;
}
40pts