#include "bits/stdc++.h"
#define sd(n) scanf("%d", &(n))
#define rep(i, x, n) for (size_t i = x, _n = (n); i < _n; ++i)
#define SZ(c) (int)(c).size()
#define lcm(a,b) (a*(b/__gcd(a,b)))
#define VI vector<int>
#define all(c) ((c).begin(), (c).end())
#define pb push_back
#define pii pair<int, int>
#define pip pair<int, pii>
#define F first
#define S second
#define mp make_pair
#define lli long long int
#define CLR(p) memset(p, 0, sizeof(p))
#define SET(p) memset(p, -1, sizeof(p))
#define INF 0x3f3f3f3f
using namespace std;
const int MOD = 1e9+7;
const int MAX = 2001;
int dx[] = {0, -1, 1, 0};
int dy[] = {1, 0, 0, -1};
char mat[2004][2004];
int visited[2004][2004];
class TheGridDivTwo
{
public:
int dfs(int p, int q, int k)
{
visited[p][q] = 1;
if(k == 0)
{
return q;
}
int maxi = INT_MIN;
rep(j, 0, 4)
{
int x = p + dx[j];
int y = q + dy[j];
if(x < 0 || y < 0 || x >= MAX || y >= MAX)
continue;
if(mat[x][y] == '.' && !visited[x][y])
{
maxi = max(maxi, dfs(x, y, k-1));
}
}
return maxi;
}
int find(vector <int> x, vector <int> y, int k)
{
int n =x.size();
if(n == 0) return k;
rep(i, 0, MAX)
rep(j, 0, MAX)
mat[i][j] = '.';
rep(i, 0, n)
mat[1000+y[i]][1000+x[i]] = 'x';
int ans = dfs(1000, 1000, k);
if(ans == INT_MIN) return 0;
return ans-1000;
}
};
int main()
{
TheGridDivTwo TG;
int n, k;
cin >> n;
VI x(n), y(n);
rep(i, 0, n)
cin >> x[i];
rep(i, 0, n)
cin >> y[i];
cin >> k;
cout << TG.find(x, y, k) << endl;
return 0;
}
I2luY2x1ZGUgImJpdHMvc3RkYysrLmgiCiNkZWZpbmUgc2Qobikgc2NhbmYoIiVkIiwgJihuKSkKI2RlZmluZSByZXAoaSwgeCwgbikgZm9yIChzaXplX3QgaSA9IHgsIF9uID0gKG4pOyBpIDwgX247ICsraSkKI2RlZmluZSBTWihjKSAoaW50KShjKS5zaXplKCkKI2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