#include <bits/stdc++.h>   using namespace std;   int main() {     int n, m, r;     cin >> n >> m >> r;     vector<int> v(n);     vector<int> v1(m);     for (int i = 0; i < n; i++) {       cin >> v[i];     }     for (int i = 0; i < m; i++) {       cin >> v1[i];     }     sort(v.begin(), v.end());     sort(v1.rbegin(), v1.rend());     if (v[0] > v1[0]) {       cout << r << endl;       return 0;     }     int cnt = 0;     cnt += r % v[0];     cnt += (r / v[0]) * v1[0];     cout << cnt;   }   