#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
#include <unordered_map>
#include <fstream>
#include <ctime>
#include <complex>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef pair<int,int> pii;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(int i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 510000;
ll dy[8] = {1,-1,0,0,1,-1,1,-1};
ll dx[8] = {0,0,1,-1,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-10;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T> inline void print(T &a){
    for(auto itr = a.begin(); itr != a.end(); itr++){
		cout << *itr << " ";
	}
    cout << "\n";
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){
	cout << "debug: " << a << " " << b << "\n";
}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << "debug: " << a << " " << b << " " << c << "\n";
}
void mark() {cout << "#" << "\n";}
ll pcount(ll x) {return __builtin_popcountll(x);}
const int mod = 1e9 + 7;
//const int mod = 998244353;

ll dp[2][50001][3];

int main(){
	int n; cin >> n;
	vl a(n), b(n);
	rep(i,n) cin >> a[i];
	rep(i,n) cin >> b[i];
	priority_queue<ll> pq0, pq1;
	ll ans = 0;
	rep(i,n){
		if(i & 1) pq1.push(a[i] - b[i]);
		else pq0.push(a[i] - b[i]);
		ans += b[i];
	}
	rep(i,n/2){
		ll s = pq1.top(); pq1.pop();
		ll t = pq0.top(); pq0.pop();
		if(s+t < 0) break;
		ans += s+t;
	}
	cout << ans << "\n";
}
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <iomanip>

using namespace std;

#define ll long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define sortall(x) sort(all(x))
#define reverseall(x) reverse(all(x))
#define to_upper(x) transform(x.begin(), x.end(), x.begin(), ::toupper)
#define to_lower(x) transform(x.begin(), x.end(), x.begin(), ::tolower)
#define FOR(i,n) for(int i=0;i<n;i++)
#define FORS(i,s,n) for(int i=s;i<n;i++)
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL); cout.tie(NULL);}
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "= " << x << ", " << #y << "= " << y << endl
#define clr(x) memset(x, 0, sizeof(x))
#define gcd __gcd
#define PI 3.1415926535897932384626
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
typedef priority_queue<int, vi, greater<int>> minpq;
typedef priority_queue<ll, vi, greater<ll>> minpql;
const int mod = 1000000007;
const double eps = 1e-14;
void YES(bool t = 1) { const string YESNO[2] = {"NO", "YES"};cout << YESNO[t] << endl; }
void Yes(bool t = 1) { const string YesNo[2] = {"No", "Yes"};cout << YesNo[t] << endl; }
void yes(bool t = 1) { const string yesno[2] = {"no", "yes"};cout << yesno[t] << endl; }
inline bool isPowerOfTwo(ll x) { return x && (!(x&(x-1))); } 
ll mpow(int b, int e, int modu=0) {
    ll result = 1,base = b, exp = e;
    if(modu) base %= mod;
    while (exp > 0) {
        if (exp & 1){
            result = ((ll)result * base) ;
            if(modu) result %= mod;
        }
        base = ((ll)base * base);
        if(modu) base %= mod;
        exp >>= 1;
    }
    return result;
}
// int64_t bpow(int b, int e){
//     int64_t result = 1,base = b, exp = e;
//     while (exp > 0) {
//         if (exp & 1){
//             result = ((int64_t)result * base) ;
//         }
//         base = ((int64_t)base * base);
//         exp >>= 1;
//     }
//     return result;
// }
// bool isPerfectSquare(long double x){long double sr = sqrt(x); return ((sr - floor(sr)) == 0);} 
// bool isIn(string &s2, string &s1){if (s1.find(s2) != string::npos) return true;return false;}
// bool isSorted(vi &arr){for(int i=0;i<(int)arr.size()-1;i++) if(arr[i] > arr[i+1]) return false;return true;}
void print_v(vi &arr){for(auto x: arr) cout << x <<',';cout << "\n";}


int TEST_CASES = 0;
void submain(){
    long double x,y,r;
    cin >> x >> y >> r;
    ll ans = 0;
    r += eps;
    for(int i=floor(x-r);i<=ceil(x+r);i++){
        // deb(i);
        long double val = r*r-(i-x)*(i-x);
        if(val >= 0){
            val = sqrt(val);
            long double vala = floor((long double)val+y);
            long double valb = ceil((long double)y-val);
            // deb2(vala, valb);
            ans += (vala-valb+1);
        }
    }
    cout << ans << '\n';
}
 


int main()
{
	// ios_base::sync_with_stdio(false);
	// cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    #endif
    send help
    if(TEST_CASES){
        int t;
        cin >> t;
        while(t--){
            submain();
        }
    }else{
        submain();
    }
	return 0;    
}