#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef unsigned int uint;
typedef unsigned long long ull;
#define repi(i, a, b) for(int i = int(a); i < int(b); i++)
#define rep(i, n) repi(i, 0, n)
#define repir(i, a, b) for(int i = int(a); i > int(b); i--)
#define repr(i, n) repir(i, n - 1, 0)
#define INF 1000000000
#define INF_LL 4000000000000000000
#define all(x) (x).begin(), (x).end()
#define UNI(x) (x).erase(unique(all(x)),(x).end())
#define F first
#define S second
#define MP make_pair
#define MT make_tuple
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

int main(){
    string a, b;
    cin >> a >> b;
    int sa = 0;
    int sb = 0;
    rep(i, a.length()){
        sa += a[i] - '0';
    }
    rep(i, b.length()){
        sb += b[i] - '0';
    }
    cout << max(sa, sb) << endl;
}

#include<bits/stdc++.h>
using namespace std;
int n,a[100010],b[100010],v[2][50010];
long long ans;
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i)scanf("%d",&a[i]),ans+=a[i];
	for(int i=1;i<=n;++i)scanf("%d",&b[i]),v[i&1][i+1>>1]=b[i]-a[i];
	sort(v[0]+1,v[0]+(n>>1)+1),sort(v[1]+1,v[1]+(n>>1)+1);
	for(int i=(n>>1);i>=1&&v[0][i]+v[1][i]>0;--i)ans+=v[0][i]+v[1][i];
	printf("%lld",ans);
	return 0;
}