#include using namespace std; #define rep(i, n) for(int (i)=0;(i)<(n);(i)++) int main() { int n, m, k; cin >> n >> m >> k; char op; cin >> op; vector b(m); vector a(n); rep(i, m) cin >> b[i]; rep(i, n) cin >> a[i]; sort(a.begin(), a.end()); sort(b.begin(), b.end()); if(op == '+') { long long total = 0; rep(i, n) { int c = k - a[i]; auto it = lower_bound(b.begin(), b.end(), c); int dist = distance(b.begin(), it); total += m - dist; } cout << total << endl; } else { long long total = 0; rep(i, n) { int c; if(k % a[i] == 0) c = k / a[i]; else c = (k / a[i] + 1); auto it = lower_bound(b.begin(), b.end(), c); int dist = distance(b.begin(), it); total += m - dist; } cout << total << endl; } }